API - FrancoBM12/API-MagicCosmetics GitHub Wiki

How do I implement it in my plugin?

here is how to implement it in your project using gradle or maven.

Methods

the types of cosmetics can be found here

MagicAPI.hasCosmetic(Player player, String cosmeticId) //returns true or false depending on whether the player has the cosmetic unlocked!
MagicAPI.hasEquipCosmetic(Player player, CosmeticType cosmeticType) //returns true or false depending on whether the player has the type of cosmetic equipped!
MagicAPI.hasEquipCosmetic(Entity entity, CosmeticType cosmeticType) //returns true or false depending on whether the entity has the type of cosmetic equipped!
MagicAPI.EquipCosmetic(Player player, String cosmeticId, String color/*In Hex, set it to null if you do not want to paint it.*/) //equip the cosmetic to player (player must have the cosmetic unlocked).
MagicAPI.EquipCosmetic(Entity entity, String cosmeticId, String color/*In Hex, set it to null if you do not want to paint it.*/) //equip the cosmetic to entity.
MagicAPI.UnEquipCosmetic(Player player, CosmeticType cosmeticType) //unequips the type of cosmetic given to the player!
MagicAPI.UnEquipCosmetic(Entity entity, CosmeticType cosmeticType) //unequips the type of cosmetic given to the entity!
MagicAPI.getCosmeticItem(String id) //returns the cosmetic item.
MagicAPI.getCosmeticId(String playerName, String type) //returns the cosmetic id.
MagicAPI.getEquipped(String playerName, String type) //returns the item of the specified equipped cosmetic.
MagicAPI.getEquipped(OfflinePlayer offlinePlayer, CosmeticType cosmeticType) //returns the item of the specified equipped cosmetic.
MagicAPI.tintItem(ItemStack item, String colorHex) //returns true if the item was dyed and false if it could not be dyed.
MagicAPI.spray(Player player) //returns true if the block the player is looking at can be drawn or false if it is not.

Custom Events

CosmeticChangeEquipEvent //Called when a player changes their cosmetic
CosmeticEquipEvent //Called when player equip a cosmetic
CosmeticUnequipEvent //Called when player unequip a cosmetic
ZoneEnterEvent //Called when a player enters the zone (wardrobe system)
ZoneExitEvent //Called when a player leaves the zone (wardrobe system)
SprayDrawingEvent //Called when a player is drawing a spray.