Package org.bukkit.inventory.meta
Interface Damageable
- All Superinterfaces:
Cloneable
,ConfigurationSerializable
,ItemMeta
,PersistentDataHolder
Represents an item that has durability and can take damage.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
int
Gets the damageint
Gets the maximum amount of damage.boolean
Checks to see if this item has damageboolean
Checks to see if this item has a maximum amount of damage.void
setDamage
(int damage) Sets the damagevoid
setMaxDamage
(Integer maxDamage) Sets the maximum amount of damage.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
Methods inherited from interface org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, getAsComponentString, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getFood, getItemFlags, getItemName, getLocalizedName, getLore, getMaxStackSize, getRarity, getTool, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchantmentGlintOverride, hasEnchants, hasFood, hasItemFlag, hasItemName, hasLocalizedName, hasLore, hasMaxStackSize, hasRarity, hasTool, isFireResistant, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setEnchantmentGlintOverride, setFireResistant, setFood, setHideTooltip, setItemName, setLocalizedName, setLore, setMaxStackSize, setRarity, setTool, setUnbreakable, setVersion
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
Method Details
-
hasDamage
boolean hasDamage()Checks to see if this item has damage- Returns:
- true if this has damage
-
getDamage
int getDamage()Gets the damage- Returns:
- the damage
-
setDamage
void setDamage(int damage) Sets the damage- Parameters:
damage
- item damage
-
hasMaxDamage
boolean hasMaxDamage()Checks to see if this item has a maximum amount of damage.- Returns:
- true if this has maximum amount of damage
-
getMaxDamage
int getMaxDamage()Gets the maximum amount of damage. Plugins should checkhasMaxDamage()
before calling this method.- Returns:
- the maximum amount of damage
-
setMaxDamage
Sets the maximum amount of damage.- Parameters:
maxDamage
- maximum amount of damage
-
clone
-