Sueta

Attributelib

1.0.0

This library will allow your plugin to edit Attributes on any item with easy.

·Plugin

This library will allow your plugin to edit Attributes on any item with easy. Alone this does nothing
This will work with future version of spigot.
Add this to your plugin.yml

depend: [Attributelib]
  1. ItemStack setAtribute(ItemStack item, attributes att, slot sl, double amount)
  2. ItemStack clearAtribute(ItemStack item)
  3. ItemStack removeAtribute(ItemStack item, attributes att, slot sl)
  4. String getVersion()
  5. boolean isItemSimiliar(ItemStack item, ItemStack SFitem, boolean lore)

Examples

setAtribute

ItemStack mainHand = player.getInventory().getItemInMainHand();
mainHand = Attributelib.setAtribute(mainHand, attributes.valueOf(args[2]), slot.valueOf(args[3]), Double.parseDouble(args[4]));
player.getInventory().setItemInMainHand(mainHand);

clearAtribute

ItemStack mainHand = player.getInventory().getItemInMainHand();
mainHand = Attributelib.clearAtribute(mainHand);
player.getInventory().setItemInMainHand(mainHand);

removeAtribute

ItemStack mainHand = player.getInventory().getItemInMainHand();
mainHand = Attributelib.removeAtribute(mainHand, attributes.valueOf(args[2]), slot.valueOf(args[3]));
player.getInventory().setItemInMainHand(mainHand);

Similar projects

Plugin →