接口 EquippableComponent

所有超级接口:
ConfigurationSerializable

@Experimental public interface EquippableComponent extends ConfigurationSerializable
表示一个可以将任何物品转变为可装备护甲的组件。
  • 方法详细资料

    • getSlot

      获取物品可以装备到的槽位。

      原文:Gets the slot the item can be equipped to.

      返回:
      槽位
    • setSlot

      void setSlot(@NotNull @NotNull EquipmentSlot slot)
      设置物品可以装备到的槽位。

      原文:Sets the slot the item can be equipped to.

      参数:
      slot - 新的槽位
    • getEquipSound

      @Nullable @Nullable Sound getEquipSound()
      获取装备物品时播放的音效。

      原文:Gets the sound to play when the item is equipped.

      返回:
      音效
    • setEquipSound

      void setEquipSound(@Nullable @Nullable Sound sound)
      设置装备物品时播放的音效。

      原文:Sets the sound to play when the item is equipped.

      参数:
      sound - 音效或null表示使用当前默认值
    • getModel

      获取装备时使用的模型键。

      原文:Gets the key of the model to use when equipped.

      返回:
      模型键
    • setModel

      void setModel(@Nullable @Nullable NamespacedKey key)
      设置装备时使用的模型键。

      原文:Sets the key of the model to use when equipped.

      参数:
      key - 模型键
    • getCameraOverlay

      @Nullable @Nullable NamespacedKey getCameraOverlay()
      获取装备时使用的相机覆盖层键。

      原文:Gets the key of the camera overlay to use when equipped.

      返回:
      相机覆盖层键
    • setCameraOverlay

      void setCameraOverlay(@Nullable @Nullable NamespacedKey key)
      设置装备时使用的相机覆盖层键。

      原文:Sets the key of the camera overlay to use when equipped.

      参数:
      key - 相机覆盖层键
    • getAllowedEntities

      @Nullable @Nullable Collection<EntityType> getAllowedEntities()
      获取可以装备此物品的实体。

      原文:Gets the entities which can equip this item.

      返回:
      实体集合
    • setAllowedEntities

      void setAllowedEntities(@Nullable @Nullable EntityType entities)
      设置可以装备此物品的实体。

      原文:Sets the entities which can equip this item.

      参数:
      entities - 实体类型
    • setAllowedEntities

      void setAllowedEntities(@Nullable @Nullable Collection<EntityType> entities)
      设置可以装备此物品的实体。

      原文:Sets the entities which can equip this item.

      参数:
      entities - 实体类型
    • setAllowedEntities

      void setAllowedEntities(@Nullable @Nullable Tag<EntityType> tag)
      设置可以装备此物品的实体类型(表示为实体 Tag)。

      原文:Set the entity types (represented as an entity Tag) which can equip this item.

      参数:
      tag - 实体标签
      抛出:
      IllegalArgumentException - 如果传入的 tag 不是实体标签
    • isDispensable

      boolean isDispensable()
      获取物品是否可以被发射器装备。

      原文:Gets whether the item can be equipped by a dispenser.

      返回:
      可装备状态
    • setDispensable

      void setDispensable(boolean dispensable)
      设置物品是否可以被发射器装备。

      原文:Sets whether the item can be equipped by a dispenser.

      参数:
      dispensable - 新的可装备状态
    • isSwappable

      boolean isSwappable()
      获取物品是否可以通过右键交换。

      原文:Gets if the item is swappable by right clicking.

      返回:
      可交换状态
    • setSwappable

      void setSwappable(boolean swappable)
      设置物品是否可以通过右键交换。

      原文:Sets if the item is swappable by right clicking.

      参数:
      swappable - 新的状态
    • isDamageOnHurt

      boolean isDamageOnHurt()
      获取当穿戴实体受到伤害时物品是否会受损。

      原文:Gets if the item will be damaged when the wearing entity is damaged.

      返回:
      物品是否会受损
    • setDamageOnHurt

      void setDamageOnHurt(boolean damage)
      设置当穿戴实体受到伤害时物品是否会受损。

      原文:Sets if the item will be damaged when the wearing entity is damaged.

      参数:
      damage - 物品是否会受损
    • isEquipOnInteract

      boolean isEquipOnInteract()
      获取物品是否会在交互时装备。

      原文:Gets if the item will be equipped on interact.

      返回:
      物品是否会被装备
    • setEquipOnInteract

      void setEquipOnInteract(boolean equip)
      设置物品是否会在交互时装备。

      原文:Sets if the item will be equipped on interact.

      参数:
      equip - 物品是否会被装备
    • isCanBeSheared

      boolean isCanBeSheared()
      获取物品是否会被剪刀剪掉。

      原文:Gets if the item will be sheared off by shears.

      返回:
      物品是否可以被剪掉
    • setCanBeSheared

      void setCanBeSheared(boolean sheared)
      设置物品是否会被剪刀剪掉。

      原文:Sets if the item will be sheared off by shears.

      参数:
      sheared - 物品是否可以被剪掉
    • getShearingSound

      @Nullable @Nullable Sound getShearingSound()
      获取物品被剪时播放的音效。

      原文:Gets the sound to play when the item is sheared.

      返回:
      音效
    • setShearingSound

      void setShearingSound(@Nullable @Nullable Sound sound)
      设置物品被剪时播放的音效。

      原文:Sets the sound to play when the item is sheared.

      参数:
      sound - 音效或null表示使用当前默认值