程序包 org.bukkit.inventory.meta

# 接口 Damageable

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

public interface Damageable extends ItemMeta
代表有耐久度、可损耗的物品.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `@NotNull Damageable`
  `clone()`
  `int`
  `getDamage()`
  获取物品的耐久度.
  `int`
  `getMaxDamage()`
  Gets the maximum amount of damage.
  `boolean`
  `hasDamage()`
  检测此物品是否有耐久度.
  `boolean`
  `hasMaxDamage()`
  Checks to see if this item has a maximum amount of damage.
  `void`
  `setDamage(int damage)`
  设置物品的耐久度.
  `void`
  `setMaxDamage(@Nullable Integer maxDamage)`
  Sets the maximum amount of damage.

  ### 从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable

  `serialize`

  ### 从接口继承的方法 org.bukkit.inventory.meta.ItemMeta

  `addAttributeModifier, addEnchant, addItemFlags, getAsComponentString, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getFood, getItemFlags, getItemName, getJukeboxPlayable, getLocalizedName, getLore, getMaxStackSize, getRarity, getTool, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchantmentGlintOverride, hasEnchants, hasFood, hasItemFlag, hasItemName, hasJukeboxPlayable, hasLocalizedName, hasLore, hasMaxStackSize, hasRarity, hasTool, isFireResistant, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setEnchantmentGlintOverride, setFireResistant, setFood, setHideTooltip, setItemName, setJukeboxPlayable, setLocalizedName, setLore, setMaxStackSize, setRarity, setTool, setUnbreakable, setVersion`

  ### 从接口继承的方法 org.bukkit.persistence.PersistentDataHolder

  `getPersistentDataContainer`

- ## 方法详细资料

  - ### 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 if this has maximum amount of damage

  - ### getMaxDamage

    int getMaxDamage()
    Gets the maximum amount of damage. Plugins should check `hasMaxDamage()` before calling this method.
    返回:
      the maximum amount of damage

  - ### setMaxDamage

    void setMaxDamage(@Nullable @Nullable Integer maxDamage)
    Sets the maximum amount of damage.
    参数:
      `maxDamage` - maximum amount of damage

  - ### clone

    @NotNull @NotNull Damageable clone()
    指定者:
      `clone` 在接口中 `ItemMeta`