Class Attributes

java.lang.Object
com.github.pinont.singularitylib.api.items.Attributes

public final class Attributes extends Object
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 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

      public static double getAttribute(org.bukkit.inventory.ItemStack item, AttributeType type)
      Sums the attribute modifier amounts currently applied to the item for the type.