Class Attributes
java.lang.Object
com.github.pinont.singularitylib.api.items.Attributes
Attribute helpers for ItemStacks (Phase 2).
Uses Bukkit's AttributeModifier API on the item's item-meta.
On Paper 26.2, ItemMeta.addAttributeModifier(Attribute, AttributeModifier)
and getAttributeModifiers(Attribute) are the modern calls.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublegetAttribute(org.bukkit.inventory.ItemStack item, AttributeType type) Sums the attribute modifier amounts currently applied to the item for the type.static org.bukkit.inventory.ItemStacksetAttribute(org.bukkit.inventory.ItemStack item, AttributeType type, double amount, org.bukkit.attribute.AttributeModifier.Operation operation) Adds an attribute modifier to the item.
-
Method Details
-
setAttribute
public static org.bukkit.inventory.ItemStack setAttribute(org.bukkit.inventory.ItemStack item, AttributeType type, double amount, org.bukkit.attribute.AttributeModifier.Operation operation) Adds an attribute modifier to the item.- Returns:
- a NEW ItemStack with the modifier applied (original untouched)
-
getAttribute
Sums the attribute modifier amounts currently applied to the item for the type.
-