接口 Damageable
代表有耐久度、可损耗的物品.
-
方法概要
修饰符和类型方法说明clone()int获取物品的耐久度.intGets the maximum amount of damage.boolean检测此物品是否有耐久度.booleanChecks to see if this item has a maximum amount of damage.voidsetDamage(int damage) 设置物品的耐久度.voidsetMaxDamage(@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, getBlocksAttacks, getBreakSound, getConsumable, getCustomModelData, getCustomModelDataComponent, getCustomTagContainer, getDamageResistant, getDisplayName, getEnchantable, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getEquippable, getFood, getItemFlags, getItemModel, getItemName, getJukeboxPlayable, getLocalizedName, getLore, getMaxStackSize, getRarity, getTool, getTooltipStyle, getUseCooldown, getUseRemainder, getWeapon, hasAttributeModifiers, hasBlocksAttacks, hasBreakSound, hasConflictingEnchant, hasConsumable, hasCustomModelData, hasCustomModelDataComponent, hasDamageResistant, hasDisplayName, hasEnchant, hasEnchantable, hasEnchantmentGlintOverride, hasEnchants, hasEquippable, hasFood, hasItemFlag, hasItemModel, hasItemName, hasJukeboxPlayable, hasLocalizedName, hasLore, hasMaxStackSize, hasRarity, hasTool, hasTooltipStyle, hasUseCooldown, hasUseRemainder, hasWeapon, isFireResistant, isGlider, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setBlocksAttacks, setBreakSound, setConsumable, setCustomModelData, setCustomModelDataComponent, setDamageResistant, setDisplayName, setEnchantable, setEnchantmentGlintOverride, setEquippable, setFireResistant, setFood, setGlider, setHideTooltip, setItemModel, setItemName, setJukeboxPlayable, setLocalizedName, setLore, setMaxStackSize, setRarity, setTool, setTooltipStyle, setUnbreakable, setUseCooldown, setUseRemainder, setVersion, setWeapon从接口继承的方法 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 checkhasMaxDamage()before calling this method.- 返回:
- the maximum amount of damage
-
setMaxDamage
Sets the maximum amount of damage.- 参数:
maxDamage- maximum amount of damage
-
clone
-