Skip to content

API Usage

Luis Bazán edited this page Feb 2, 2024 · 7 revisions

Get all kits

KitsAPI.getKits(); // return a List<Kit>

Get specific kit

KitsAPI.getKit(kitName); // return a Kit object, can be null

Get kitsHelper

KitsHelper // It's the specific class for plugins that want to use the API in a formal way.

Register kit as Plugin

  • plugin - String or Plugin class.
  • kit - Kit class.
KitsHelper.registerPluginKit(plugin, kit);

Create Kit From Player

  • player - Player
KitsHelper.createKitFromPlayer(player);

Get kit as Plugin

  • plugin - String or Plugin class.
  • name - String class.
  • It's nullable
KitsHelper.getPluginKit(plugin, name);

Resolve kit as Plugin

  • plugin - String or Plugin class.
  • name - String class.
  • If the kit does not exist, create one.
KitsHelper.resolvePluginKit(plugin, name);

Get Plugin Kits Manager

KitsHelper.getKitManager(your_plugin_instance); // return a PluginKitsManager, It is a class to administer permanent kits to a player.

Set permanent Kit

  • player - Player class.
  • kit - Kit class.
  • If this method is called two or more times, it will only rewrite the kit. In case you want to leave the player use cancelTrack().
  • The plugin will not stop trying to put the Kit to the player even if he disconnects, the only way is to use cancelTrack()
pluginKitsManager.setPermanentKit(player, kit);

Cancel permanent Kit

  • player - Player class.
pluginKitsManager.cancelTrack(player);

Clone this wiki locally