接口 Damageable

所有超级接口:
Cloneable, ConfigurationSerializable, ItemMeta, PersistentDataHolder

public interface Damageable extends ItemMeta
代表有耐久度、可损耗的物品.
  • 方法详细资料

    • hasDamage

      boolean hasDamage()
      检测此物品是否有耐久度.

      原文: Checks to see if this item has damage

      返回:
      此物品是否有耐久度
    • getDamage

      int getDamage()
      获取物品的耐久度.

      原文: Gets the damage

      返回:
      耐久度
    • setDamage

      void setDamage(int damage)
      设置物品的耐久度.

      原文: Sets the damage

      参数:
      damage - 物品耐久度
    • hasMaxDamage

      boolean hasMaxDamage()
      检查此物品是否有最大耐久度设置.

      原文: Checks to see if this item has a maximum amount of damage.

      返回:
      如果设置了最大耐久度则返回 true
    • getMaxDamage

      int getMaxDamage()
      获取最大耐久度.

      插件在调用此方法前应检查 hasMaxDamage() 是否返回 true.

      原文: Gets the maximum amount of damage.

      Plugins should check hasMaxDamage() before calling this method.

      返回:
      最大耐久度
    • setMaxDamage

      void setMaxDamage(@Nullable @Nullable Integer maxDamage)
      设置最大耐久度.

      原文: Sets the maximum amount of damage.

      参数:
      maxDamage - 最大耐久度
    • clone

      指定者:
      clone 在接口中 ItemMeta