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
This will work with future version of spigot.
Add this to your plugin.yml
Code (Text):
depend: [Attributelib]
- ItemStack setAtribute(ItemStack item, attributes att, slot sl, double amount)
- ItemStack clearAtribute(ItemStack item)
- ItemStack removeAtribute(ItemStack item, attributes att, slot sl)
- String getVersion()
- boolean isItemSimiliar(ItemStack item, ItemStack SFitem, boolean lore)
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);
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);
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);
mainHand = Attributelib.removeAtribute(mainHand, attributes.valueOf(args[2]), slot.valueOf(args[3]));
player.getInventory().setItemInMainHand(mainHand);
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.12
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
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.