Interface EquippableComponent
- All Superinterfaces:
ConfigurationSerializable
Represents a component which can turn any item into equippable armor.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the item can be unequipped when interacting with an entity using shears.Gets 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.Gets the sound to play when the item is sheared.getSlot()Gets the slot the item can be equipped to.booleanGets if the item will be damaged when the wearing entity is damaged.booleanGets whether the item can be equipped by a dispenser.booleanGets if the item should be equipped when interacting with an entity.booleanGets if the item is swappable by right clicking.voidsetAllowedEntities(@Nullable Collection<EntityType> entities) Sets the entities which can equip this item.voidSet the entity types (represented as an entityTag) which can equip this item.voidsetAllowedEntities(@Nullable EntityType entities) Sets the entities which can equip this item.voidSets the key of the camera overlay to use when equipped.voidsetCanBeSheared(boolean sheared) Sets if the item can be unequipped when interacting with an entity using shears.voidsetDamageOnHurt(boolean damage) Sets if the item will be damaged when the wearing entity is damaged.voidsetDispensable(boolean dispensable) Sets whether the item can be equipped by a dispenser.voidsetEquipOnInteract(boolean equip) Sets if the item should be equipped when interacting with an entity.voidsetEquipSound(@Nullable Sound sound) Sets the sound to play when the item is equipped.voidSets the key of the model to use when equipped.voidsetShearingSound(@Nullable Sound sound) Sets the sound to play when the item is sheared.voidsetSlot(@NotNull EquipmentSlot slot) Sets the slot the item can be equipped to.voidsetSwappable(boolean swappable) Sets if the item is swappable by right clicking.Methods inherited from interface ConfigurationSerializable
serialize
-
Method Details
-
getSlot
-
setSlot
Sets the slot the item can be equipped to.- Parameters:
slot- new slot
-
getEquipSound
-
setEquipSound
-
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 passedtagis 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
-
isEquipOnInteract
boolean isEquipOnInteract()Gets if the item should be equipped when interacting with an entity.- Returns:
- whether the item equips on interact
-
setEquipOnInteract
void setEquipOnInteract(boolean equip) Sets if the item should be equipped when interacting with an entity.- Parameters:
equip- whether the item equips on interact
-
canBeSheared
boolean canBeSheared()Checks if the item can be unequipped when interacting with an entity using shears.- Returns:
- whether the item can be unequipped using shears
-
setCanBeSheared
void setCanBeSheared(boolean sheared) Sets if the item can be unequipped when interacting with an entity using shears.- Parameters:
sheared- whether the item can be unequipped using shears
-
getShearingSound
-
setShearingSound
-