Interface EquippableComponent

All Superinterfaces:
ConfigurationSerializable

@Experimental public interface EquippableComponent extends ConfigurationSerializable
Represents a component which can turn any item into equippable armor.
  • Method Details

    • getSlot

      Gets the slot the item can be equipped to.
      Returns:
      slot
    • setSlot

      void setSlot(@NotNull @NotNull EquipmentSlot slot)
      Sets the slot the item can be equipped to.
      Parameters:
      slot - new slot
    • getEquipSound

      @NotNull @NotNull Sound getEquipSound()
      Gets the sound to play when the item is equipped.
      Returns:
      the sound
    • setEquipSound

      void setEquipSound(@Nullable @Nullable Sound sound)
      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

      void setModel(@Nullable @Nullable NamespacedKey key)
      Sets the key of the model to use when equipped.
      Parameters:
      key - model key
    • getCameraOverlay

      @Nullable @Nullable NamespacedKey getCameraOverlay()
      Gets the key of the camera overlay to use when equipped.
      Returns:
      camera overlay key
    • setCameraOverlay

      void setCameraOverlay(@Nullable @Nullable NamespacedKey key)
      Sets the key of the camera overlay to use when equipped.
      Parameters:
      key - camera overlay key
    • getAllowedEntities

      @Nullable @Nullable Collection<EntityType> getAllowedEntities()
      Gets the entities which can equip this item.
      Returns:
      the entities
    • setAllowedEntities

      void setAllowedEntities(@Nullable @Nullable EntityType entities)
      Sets the entities which can equip this item.
      Parameters:
      entities - the entity types
    • setAllowedEntities

      void setAllowedEntities(@Nullable @Nullable Collection<EntityType> entities)
      Sets the entities which can equip this item.
      Parameters:
      entities - the entity types
    • setAllowedEntities

      void setAllowedEntities(@Nullable @Nullable Tag<EntityType> tag)
      Set the entity types (represented as an entity Tag) which can equip this item.
      Parameters:
      tag - the entity tag
      Throws:
      IllegalArgumentException - if the passed tag 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