Interface EquippableComponent
- All Superinterfaces:
ConfigurationSerializable
Represents a component which can turn any item into equippable armor.
-
Method Summary
Modifier and TypeMethodDescriptionGets the entities which can equip this item.Gets the key of the camera overlay to use when equipped.Gets the sound to play when the item is equipped.getModel()
Gets the key of the model to use when equipped.getSlot()
Gets the slot the item can be equipped to.boolean
Gets if the item will be damaged when the wearing entity is damaged.boolean
Gets whether the item can be equipped by a dispenser.boolean
Gets if the item is swappable by right clicking.void
setAllowedEntities
(Collection<EntityType> entities) Sets the entities which can equip this item.void
setAllowedEntities
(EntityType entities) Sets the entities which can equip this item.void
setAllowedEntities
(Tag<EntityType> tag) Set the entity types (represented as an entityTag
) which can equip this item.void
Sets the key of the camera overlay to use when equipped.void
setDamageOnHurt
(boolean damage) Sets if the item will be damaged when the wearing entity is damaged.void
setDispensable
(boolean dispensable) Sets whether the item can be equipped by a dispenser.void
setEquipSound
(Sound sound) Sets the sound to play when the item is equipped.void
setModel
(NamespacedKey key) Sets the key of the model to use when equipped.void
setSlot
(EquipmentSlot slot) Sets the slot the item can be equipped to.void
setSwappable
(boolean swappable) Sets if the item is swappable by right clicking.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
Method Details
-
getSlot
Gets the slot the item can be equipped to.- Returns:
- slot
-
setSlot
Sets the slot the item can be equipped to.- Parameters:
slot
- new slot
-
getEquipSound
Gets the sound to play when the item is equipped.- Returns:
- the sound
-
setEquipSound
Sets the sound to play when the item is equipped.- Parameters:
sound
- sound or null for current default
-
getModel
Gets the key of the model to use when equipped.- Returns:
- model key
-
setModel
Sets the key of the model to use when equipped.- Parameters:
key
- model key
-
getCameraOverlay
Gets the key of the camera overlay to use when equipped.- Returns:
- camera overlay key
-
setCameraOverlay
Sets the key of the camera overlay to use when equipped.- Parameters:
key
- camera overlay key
-
getAllowedEntities
Gets the entities which can equip this item.- Returns:
- the entities
-
setAllowedEntities
Sets the entities which can equip this item.- Parameters:
entities
- the entity types
-
setAllowedEntities
Sets the entities which can equip this item.- Parameters:
entities
- the entity types
-
setAllowedEntities
Set the entity types (represented as an entityTag
) which can equip this item.- Parameters:
tag
- the entity tag- Throws:
IllegalArgumentException
- if the passedtag
is not an entity tag
-
isDispensable
boolean isDispensable()Gets whether the item can be equipped by a dispenser.- Returns:
- equippable status
-
setDispensable
void setDispensable(boolean dispensable) Sets whether the item can be equipped by a dispenser.- Parameters:
dispensable
- new equippable status
-
isSwappable
boolean isSwappable()Gets if the item is swappable by right clicking.- Returns:
- swappable status
-
setSwappable
void setSwappable(boolean swappable) Sets if the item is swappable by right clicking.- Parameters:
swappable
- new status
-
isDamageOnHurt
boolean isDamageOnHurt()Gets if the item will be damaged when the wearing entity is damaged.- Returns:
- whether the item will be damaged
-
setDamageOnHurt
void setDamageOnHurt(boolean damage) Sets if the item will be damaged when the wearing entity is damaged.- Parameters:
damage
- whether the item will be damaged
-