Heads Plugin API 3 [1.17 - 1.21.x] icon

Heads Plugin API 3 [1.17 - 1.21.x] -----

Make it easy to use or spawn custom created textured heads from your plugins.




Bug fixes:
  • Fixed errors, caused by that the user profile could contain an invalid name. This was only an issue in MC 1.21 and newer.
----------, Dec 17, 2024

MAJOR PERFORMANCE IMPROVEMENT
This version of the plugin finally addresses the slow startup time.

Before this update you could expect the plugin to sometimes take over 20 minutes before it was done updating categories. Now, after this update, this time is brought down to under a minute (usually between 15 and 30 seconds),

I highly recommend to update to this version if you frequently restart your server and still want to keep the categories up-to-date, because this will allow your players to be able to use commands from any plugin that uses this API (like HeadsInventory and HeadSweeper) way sooner.

If you changed the default values for search.update.interval and categories.update.interval, because of the slow category updates, now would be the time to change those back to their default values (or any other value you like. It's your choice):


Code (YAML):
 search:
    update
:
      # search update interval in minutes
      interval
: 1440 # 1 day
  categories
:
    update
:
      # category update interval in hours
      interval
: 168 # 1 week
----------, Apr 13, 2024

New features;

- Events are added for when a category is done updating and for when all categories are done updating.
- You can now specify in the config who will get a message when a category is done updating (`notifyEach`) and when all categories are done updating (`notify`):

upload_2023-12-19_18-11-24.png

More info about the events is available on the wiki.
----------, Dec 19, 2023

Add support for MC 1.20.2

Bug fixes:
  • Fix a Mojang Authlib related issue when creating head metadata
----------, Oct 21, 2023

Add support for MC 1.20.1

Bug fixes:
  • fix compatibility issues with SnakeYAML 2.0 (the plugin now works with both version 1.x and 2.0, to remain backwards compatible)
----------, Jun 25, 2023

Freshcoal seems to be down right now and the plugin didn't like that. This update makes the plugin able to handle this.

Fixes:
  • Properly catch 404 errors
  • Properly implement the ability to disable a heads providers
----------, Mar 22, 2023

Changes:
- Removed dependency on NBT API, so it doesn't require an update for every Minecraft version anymore

Fixes:
- Fixed a startup issue related to creating the categories if they don't exist yet.
----------, Sep 11, 2022

Updated NBT API to support 1.19
----------, Jun 15, 2022

This version now supports minecraft version 1.18.2.
----------, Mar 19, 2022

Changes:

  • Fixed a critical bug that caused category searches to take way longer, even crashing the server in some cases. See #22
  • Fixed a bug that the config file wasn't taken into account. It only looked at the default config file inside the jar file before.

More performance and instability fixes might come soon, but this one was so important due to the server crashing potential that it was necessary to release this as soon as possible.
----------, Feb 19, 2022

Changes:

  • switched over from spring to dagger and from hibernate to openjpa, to significantly reduce the file size.
  • made category loading asynchronous
  • updated dependencies (Including NBT api)
  • removed the requirement for extra server command line parameters (-illegal-access=permit --add-opens java.base/java.lang.invoke=ALL-UNNAMED is no longer needed)
This version supports 1.17 and newer and requires the server to use Java 17 (or newer).

For developers
The API for plugin development can be found here: CC007/HeadsPluginAPI/packages/1160225
----------, Feb 13, 2022

The plugin has been updated to work with java 1.17 and 1.17.1.

Attention!
If you are using java 16 and newer (which is required for Minecraft 1.17+), you will need to add the following to your startup script of the server:
Code (Text):
--illegal-access=permit --add-opens java.base/java.lang.invoke=ALL-UNNAMED
In Java 15 and earlier, these settings were the default, but Java 16 made the way you interact with certain parts of the code more strict. These parameters are needed for my plugin to work correctly, due to my use of the Spring Framework.

As an example, the startup.bat script could look something like this:
Code (Text):
@echo off
java --illegal-access=warn --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED -Xmx4g -jar spigot.jar
pause
----------, Jul 15, 2021

Changes:

  • Updated NBT API to 2.6.0 for compatibility with minecraft 1.16.4
  • Enabled minecraft-heads.com by default again
----------, Nov 8, 2020

This release makes the plugin compatible with 1.16.2 and temporarily disables searching in minecraft-heads by default in the config.yml file.

Once the minecraft-heads API on their website is back up, this can be re-enabled:
Code (YAML):
headsplugin :
  # define which heads database should be enabled.
  provider
:
   freshcoal
: true
   mineskin
: true
   minecraftHeads
: false # <-- turn this back to true once the API works again (I will notify when this is the case in the announcements of my discord channel)
----------, Sep 1, 2020

FreshCoal is no longer displaying a 502 error, so I now reenabled the default config parameter to search using FreshCoal.

This only affects the default config, so if you already are running HeadsPluginAPI, you don't need to update.

I do however highly advice you to reenable Freshcoal searching in your own config file again. This allows you to be able to use all categories and therefore also greatly benefits the use of HeadsInventory. You can do this in the config.yml file:

Code (YAML):
# ...
headsplugin
:
  # define which heads database should be enabled.
  provider
:
   freshcoal
: true     # <--  change this value back to true
   mineskin
: true
   minecraftHeads
: true
  #...
----------, Aug 16, 2020

Bugfix release to fix loading issues when the zPermissions and Multiverse-core plugin are also installed. (issue #10)

zPermissions uses an old version of a library that is incompatible with this plugin. If zPermissions loads first, this causes issues. Multiverse-core used to be a softdepend and this made zPermission load before HeadsPluginAPI too.

This update enforces that HeadsPluginAPI loads before zPermissions.
----------, Aug 15, 2020

This update fixes a performance issue that caused servers with a short timeout to complain about being non responsive for way too long.

Also, it is now possible to disable internet requests to specific heads databases.
By default this is configurated like this:
Code (YAML):
# ...
headsplugin
:
  # define which heads database should be enabled.
  provider
:
   freshcoal
: false
   mineskin
: true
   minecraftHeads
: true
  #...

For now FreshCoal is disabled by default, because of the current problems with accessing that website. Once/if FreshCoal is up and running again, you can set the above config property back to true, to make calls to FreshCoal again.
Categories from FreshCoal that have been updated and cached before the website was down will continue to work, however they obviously won't be updated.
----------, Jul 21, 2020

Sorry, previous download link didn't work. This one should.
----------, Jul 21, 2020

The past week Freshcoal seemed to have gone down. This caused startup issues for my plugin.

There was also an issue related to commands fired from command blocks. After an update of one of the libraries that my plugin uses, this issue has now been resolved.
----------, Jul 20, 2020

The HeadPlacer didn't work correctly in 1.16, because of changes in the NBT data format of a head block.This is now fixed

This version (or newer) is needed for HeadSweeper 1.6.x
----------, Jul 4, 2020

Fixed that search was case sensitive for heads that originated from categories. After the fix it doesn't matter anymore that heads have capitals in the name when searching for heads.
----------, Jul 4, 2020

Remember how in my last update I took about 1.5 years to update the plugin to a new version, because of the plugin rewrite? Well, the rewrite definitely paid off, because this time I was able to fix the compatibility issues between versions within 3 days of the official release of MC 1.16. I feel like it could definitely have taken another week or 2 if I had to fix this in the old version of the plugin.

So everyone who'd like to update their server to minecraft 1.16.x, my plugin won't stop you anymore :D
----------, Jun 26, 2020

This version slightly reduces the file size of the plugin (by about 200kB)

If you have HeadsPluginAPI 2.0.0 it is not worth to update to this version (unless you really want to ;)).
----------, Jun 20, 2020

This marks the release of version 2.0.0 of the plugin.

It has completely been rewritten from the ground up and now provides a few extra functionalities, like searching for uuids.

The category update command has also been moved from HeadsInventory to this plugin.


NOTE: this version of HeadsPluginAPI is NOT backwards compatible with older versions of the plugin and only works with Bukkit/Spigot version 1.13 and newer!

The plugin provides the following /headspluginapi commands (/hpa for short):

  • /headspluginapi (listcategories | listcat | lstcat | list | lst | showcategories | showcat | shwcat | show | shw)
    Show a list of all categories

  • /headspluginapi (update | up | updateheads | uh | uphds) [CATEGORY_NAME]
    Update all or a specific category (requires the headspluginapi.update permission)
If you find any bugs or issues you can report it on my Discord channel and/or in my issue tracker: https://github.com/CC007/HeadsPluginAPI/issues
----------, Jun 15, 2020

Release 1.9.0: this version adds support for using the minecraft-heads.com categories as predefined categories. This was needed, because the custom search broke down after a change to that website. The owner of that website made me aware of a REST api that the website provides. It is for now limited to providing categorized heads, but he said that he is planning to provide a more extensive api after his website updates.

Sadly this means that getHeads using the MinecraftHeadsLoader will no longer be available, but fortunately you get access to the following categories from minecraft-heads.com: mh-alphabet, mh-animals, mh-blocks, mh-decoration, mh-food-drinks, mh-humans, mh-humanoid, mh-miscellaneous, mh-monsters and mh-plants.

Furthermore, I now started to put the category cache files in a subfolder called 'cache'. This makes it way easier to find the config files in the plugin/HeadsPluginAPI folder.

For all previously mentioned changes I needed to make quite some changes to both the categories.yml and config.yml. While all changes are backwards compatible (I think), it would have meant that some config values would be missing or changed, causing the new features to be nonfunctional.

For that reason I changed the plugin so that when a new version is released, it will change the config to the new default.This means that any changes you made to config.yml or categories.yml need to be backed up before updating the plugin and re-added what you need from the config files after the update! You most likely only changed categories.yml if you added extra custom categories. And you probably only changed config.yml if you changed the timeout for connecting to the databases.
----------, Feb 17, 2019

Release 1.8.0: after hours of looking through bukkit documentation and minecraft server source code, I was finally able to unify the code for the <=1.12 version and the 1.13 version.

Also I fixed a few bugs with regards to placing the heads (used in HeadSweeper).

I will however drop official support for 1.7.10. It might still work, but if it doesn't I will refer you to use an older version (1.7.1).
----------, Jan 26, 2019

There was a bug when searching through minecraft-heads.com if there were more than 80 results (one full page worth of heads on minecraft-heads.com). This has now been fixed.

Thanks go out to CobaltRisen for finding this bug :D
----------, Aug 13, 2018

Due to some people still downloading the 1.13 version for their older servers, I decided to make a download available where they can download both the version for 1.8-1.12.2 and the version for 1.13.
----------, Aug 12, 2018

This update does NOT work on 1.12.2 or earlier servers! It is meant only for version 1.13 and up. Download 1.7.0 if you have a server that uses version 1.12.2 or earlier.

With that out of the way: here is the update that supports version 1.13! :D

This version is needed if you want HeadsInventory, HeadSweeper and other plugins dependent on this API to work in 1.13.

It supports all the searching and item stack creation features that HeadsPluginAPI 1.7.0 has. It also partially supports head placements. Partial because:
- The placement of wallmounted heads in HeadPlacer will (most likely) not work (due to them now being a separate item type in 1.13)
- Rotation of heads is based on BlockFace in stead of an int between 0 and 15, which could cause backwards compatibility issues. (if someone could send me a code snippet of magic value to BlockFace conversion, that would be appreciated)
----------, Aug 11, 2018

As requested by a few of the users, the API now supports heads from minecraft-heads.com

IMPORTANT: Searching through this database is very slow! While it doesn't impact the performance of the server itself, it can take between 1 and 3 seconds per head to load. This means that trying to load 50 heads can take over 2.5 minutes! This is a limitation on the side of the database, not on the side of the plugin, so I have no control over this. While the search is in progress, you can still do everything in minecraft and it shouldn't cause any disconnects.


Server owners:
You can add a custom categories that use minecraft-heads.com in the following way to categories.yml:

Code (Text):
customcategories:
    doge:
        id: 14
        loader: minecraftheads
        urls:
        - doge

Plugin writers:
Everything works just like before. The only thing that really changed is the addition of the MinecraftHeadsLoader class, which is the DatabaseLoader implementation for minecraft-heads.com.

Because of how slow the heads load, I added a CommandSender parameter to the constructor of MinecraftHeadsLoader. If null, the class behaves just like the other DatabaseLoader implementations, but if a sender is provided, then the progress of loading the search results are shown to that sender (in increments of 5).

Example: when using HeadsInventory, doing the /headsinv mhsearch dog command will show the following messages to the person that did the command:
Code (Text):
[HeadsPluginAPI] Loading 41 heads. Please wait...
[HeadsPluginAPI] 0/41
[HeadsPluginAPI] 5/41
[HeadsPluginAPI] 10/41
[HeadsPluginAPI] 15/41
[HeadsPluginAPI] 20/41
[HeadsPluginAPI] 25/41
[HeadsPluginAPI] 30/41
[HeadsPluginAPI] 35/41
[HeadsPluginAPI] 40/41
[HeadsInventory] Choose a head from the inventory...
----------, Feb 28, 2018

Due to a lot of people getting confused about the naming of the plugin, I decided to change the name to Heads Plugin API. I hope that this will reduce the amount of people that think this is the only plugin that they need. I also slightly changed the description of Heads Plugin API, HeadsInventory and HeadSweeper to reflect this change.
----------, Feb 11, 2018

Freshcoal updated their website, so that it is way more modern and super fast. This update will make it so that the plugin will work with the new website.

Other than the compatibility, nothing has changed.
----------, Dec 22, 2017

Release 1.6.1
- Made it so that you can do the /heads command without having HeadsInventory installed. It will tell you that you need to install HeadsInventory for that functionality (added because a lot of people kept saying they couldnt find any commands, because they dont know what an API is)

Release 1.6.0
- Added support for adding a player skin to the Mineskin.org database using the following code:
Code (Text):
HeadsUtils hu = HeadsUtils.getInstance();
hu.setDatabaseLoader(new MineSkinLoader());
newHead = hu.saveHead(player, headName);
hu.setDatabaseLoader(HeadsPlugin.getDefaultDatabaseLoader());
----------, Nov 11, 2017

Today we release version 1.5.0! This version includes support for searching through the MineSkin database, the website from Inventivetalent that has a skin/heads database just like Freshcoal. While this database has less heads than Freshcoal, searching through it is way faster than searching through Freshcoal's database.

For server owners
If you are creating a custom category in the categories.yml, you can select which database to use by specifying the loader to be either freshcoal or mineskin. Example:


Code (Text):
customcategories:
  rwby:
    id: 13
    loader: freshcoal
    urls:
    - rwby
  cat:
    id: 14
    loader: mineskin
    urls:
      - cat
Dependent plugins:
- HeadsInventory will need to be updated to version 1.4.0
- HeadSweeper 1.2.0 is still compatible with this new version of HeadsPlugin

The default config files have changed, so don't forget to check those if you have any problems upgrading to the new version

For plugin developers
The API remained mosly the same. The only thing that changed is that the HeadsUtils class has one extra method:
Code (Text):
public void setDatabaseLoader(DatabaseLoader loader)
With this method you can set to either use the MineSkinLoader or the FreshCoalLoader:
Code (Text):
HeadsUtils hu = HeadsUtils.getInstance();

// get heads from the MineSkin database
hu.setDatabaseLoader(new MineSkinLoader());
List<Head> mineSkinHeads = hu.getHeads("cat");

// get heads from the FreshCoal database
hu.setDatabaseLoader(new FreshCoalLoader());
List<Head> freshCoalHeads = hu.getHeads("cat");

// get heads from the default database (Freshcoal by default)
hu.setDatabaseLoader(HeadsPlugin.getDefaultDatabaseLoader());
List<Head> defaultDbHeads = hu.getHeads("cat");

For backwards compatibility, don't forget to set the loader back to freshcoal

Other than that the JavaDoc is included in the previous download (v 1.4.2)
----------, May 5, 2017

Changes v1.4.2
- small fixes for nullpointer exceptions when a category cannot be found.
- added a zip with a backup cache so that new users can use the plugin when the website is down (you can ignore this zip if you already have a server with this plugin active. If you are a new user and the heads.freshcoal.com website is down, put the contents of this zip in the HeadsPlugin folder in your server's plugin folder)
----------, Oct 10, 2016

Changes v1.4.1
- added javadoc to download for plugin development (you can ignore javadoc when you just want to use this plugin)

Changes v1.4.0

- added searching for categories by id in the API, which is needed for the categories UI in HeadsInventory 1.3.0
----------, Oct 10, 2016

CC007 and I (Flexo013) have been working on on this plugin for a year now and it has been great. To make sure that more people can enjoy the plugin and everything it has to offer we have made the entire plugin FREE!

- All features and functionalities will work for free!
- There is no more need to go through our website
- The annoyingly complex setup part has been simplified

We hope you enjoy the new version of the plugin and let us know if you have any ideas for improvements or if you find any bugs.

~Flexo

P.S.: We provide support for the plugin on Discord
----------, Oct 7, 2016

version 1.2.2 has been released. This is a minor release that is not necessary for those who are already set up, but it makes it easier to set up the plugin.

Features:
  • A new command has been added: '/headsplugin setworld <worldname>'. This command makes it possible to set a parameter from the config file directly through minecraft. No need to edit the config file manually and no need to restart the server.
Bugs:
  • (fixed)There was a bug concerning the world name in the config file. If the world did not exist, the plugin would crash on startup (the server itself would be fine).
  • (partially fixed)Some log lines from the plugin don't contain the [HeadsPlugin] tag. Some instances of this have been fixed in this release. More will follow later.
----------, Apr 6, 2016

Resource Information
Author:
----------
Total Downloads: 66,407
First Release: Mar 7, 2016
Last Update: Dec 17, 2024
Category: ---------------
All-Time Rating:
18 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings