Home›Java›Mods›Item attribute modifier API Library
Item attribute modifier API Library
ModsJava

Item attribute modifier API Library

Java mod listed for Minecraft 1.8–1.9. Downloads from the MC Java Mods app on Android.

⬇ Download on Spigot
Item Attribute API

This library offers you the opportunity to handle attribute modifiers on item stacks.

Background:
Attributes are properties of mobs and players ( http://minecraft.gamepedia.com/Attribute).
These attributes can be modified ( http://minecraft.gamepedia.com/Attribute#Modifiers).
These attribut modifiers can be deposited on items ( http://minecraft.gamepedia.com/Player.dat_format#Attribute_Modifiers).
This library allows to handle such modifiers on items.

Features:
For a detailed description of attributes and their modifiers see the MC wiki (Links above)

How to use:
This is not a plugin. Don't paste it into a plugins folder of a MC server.
Download the JAR and import it into your IDE.
How to Import a external library in Eclipse -> TUTORIAL
Code (Java):
import minecraft.spigot.community.michel_0.api.Attribute ;
import minecraft.spigot.community.michel_0.api.AttributeModifier ;
import minecraft.spigot.community.michel_0.api.ItemAttributes ;
import minecraft.spigot.community.michel_0.api.Slot ;

ItemStack item = /* ...some item you want to modify... */ ;

// First you need a new instance of ItemAttributes
ItemAttributes attributeModifiers = new ItemAttributes ( ) ;

// Then you need to define your modifiers
AttributeModifier speedModifier = new AttributeModifier ( Attribute. MOVEMENT_SPEED, "AdditionalSpeed", Slot. MAIN_HAND, 0, 1.0d, UUID. randomUUID ( ) ) ;
AttributeModifier attackModifier = new AttributeModifier ( Attribute. ATTACK_DAMAGE, "AdditionalDamage", Slot. MAIN_HAND, 0, 4.0d, UUID. randomUUID ( ) ) ;

// Next is to add these modifiers to the attribut modifiers set
attributeModifiers. addModifier (speedModifier ) ;
attributeModifiers. addModifier (attackModifier ) ;

// Finally apply it on a item stack
item = attributeModifiers. apply (item ) ;
Need additional Features or got some interesting ideas?
Leave a reply and i'll add this or other functions if requested.

Special thanks @wd40bomber7 who gave me the idea for this API ( here).

Replys and ratings and suggestions welcome.

Spoiler: Some possible example applications
  • Add extra attack damage, on some weapon (e.g. sword)
  • Add special armor or knockback defense on some armor parts
  • Add speed boost on a special fastwalk item
  • Add additional horse jump power on horse armor
  • ... endless possibillities ...
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.

Item attribute modifier API Library is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9. Downloaded 1,115 times (via Spigot). Download it and open it directly in the game.

Explore more