HomeJavaModsAttributelib
Attributelib
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
Code (Text):
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
Code (Text):
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
Code (Text):
ItemStack mainHand = player.getInventory().getItemInMainHand();
mainHand = Attributelib.clearAtribute(mainHand);
player.getInventory().setItemInMainHand(mainHand);
removeAtribute
Code (Text):
ItemStack mainHand = player.getInventory().getItemInMainHand();
mainHand = Attributelib.removeAtribute(mainHand, attributes.valueOf(args[2]), slot.valueOf(args[3]));
player.getInventory().setItemInMainHand(mainHand);
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Attributelib is a free Minecraft Java mod. Compatible with Minecraft 1.12. Downloaded 316 times (via Spigot). Download it and open it directly in the game.

Explore more