Sueta
[A

[API] ResourcePackApi [1.7 | 1.8 | 1.9 | 1.10]

2.2.1

API to know about the acceptance of Resourcepacks

·Plugin

This API adds a ResourcePackStatusEvent which is called when a Player accepts or declines a resource pack.
It also includes method the send resource packs with a custom hash.


I enjoy making all of my plugins for free, but I need your help to keep them for free.


Example:

@EventHandler
    public void onResourcePackStatus(ResourcePackStatusEvent e) {
        e.getPlayer();// Player that accepted/declined the resource pack
        e.getStatus();// Status of the resource pack (SUCCESSFULLY_LOADED, DECLINED, FAILED_DOWNLOAD, ACCEPTED)
        e.getHash();// Hash of the resource pack (Can be set with ResourcePackAPI#setResourcepack)
    }
ResourcePackAPI.setResourcepack(Bukkit.getPlayer("inventivetalent"), "http://path/to/resource/pack.zip", "amazing_resource_pack");

Note: getHash dos not work in 1.10, since it is no longer sent by the client.

Currently compatible with the following versions

  • 1.7.10 (Protocol hack)
  • 1.8.0 - 1.8.9
  • 1.9
  • 1.10 (not fully tested)

Maven

Links

SlZOd2EkUm9kI1J3YW1GeUooVWtXa2QzZFdGPk4rSmFWelV3WVZoYWJHUiNSbk5hVnpVdytHMDVlVnAzUCswa0okUk1NMEp6WkZka2NHSnBPRDBrSiRSalIzZypXakpzZFZ7VyRtKmpNamsqWTIxT2JGViNSbXBoTUVaUlUxTmFNbHBZJG5waFZ6bDFVRk5XTWxwWSRucGhWemwxJGxFOVAkUiNaPlFs

Please leave a rating if you like this resource.
Donations to support me or this resource are also very much appreciated.

Similar projects

Plugin →