Interface Damageable

All Superinterfaces:
Cloneable, ConfigurationSerializable, ItemMeta, PersistentDataHolder

public interface Damageable extends ItemMeta
Represents an item that has durability and can take damage.
  • Method Details Link icon

    • hasDamage Link icon

      boolean hasDamage()
      Checks to see if this item has damage
      Returns:
      true if this has damage
    • getDamage Link icon

      int getDamage()
      Gets the damage
      Returns:
      the damage
    • setDamage Link icon

      void setDamage(int damage)
      Sets the damage
      Parameters:
      damage - item damage
    • hasMaxDamage Link icon

      boolean hasMaxDamage()
      Checks to see if this item has a maximum amount of damage.
      Returns:
      true if this has maximum amount of damage
    • getMaxDamage Link icon

      int getMaxDamage()
      Gets the maximum amount of damage. Plugins should check hasMaxDamage() before calling this method.
      Returns:
      the maximum amount of damage
    • setMaxDamage Link icon

      void setMaxDamage(@Nullable Integer maxDamage)
      Sets the maximum amount of damage.
      Parameters:
      maxDamage - maximum amount of damage
    • clone Link icon

      @NotNull Damageable clone()
      Specified by:
      clone in interface ItemMeta