接口 EquippableComponent
- 所有超级接口:
ConfigurationSerializable
-
方法概要
修饰符和类型方法说明获取可以装备此物品的实体。获取装备时使用的相机覆盖层键。获取装备物品时播放的音效。getModel()获取装备时使用的模型键。获取物品被剪时播放的音效。getSlot()获取物品可以装备到的槽位。boolean获取物品是否会被剪刀剪掉。boolean获取当穿戴实体受到伤害时物品是否会受损。boolean获取物品是否可以被发射器装备。boolean获取物品是否会在交互时装备。boolean获取物品是否可以通过右键交换。voidsetAllowedEntities(@Nullable Collection<EntityType> entities) 设置可以装备此物品的实体。voidsetAllowedEntities(@Nullable EntityType entities) 设置可以装备此物品的实体。void设置可以装备此物品的实体类型(表示为实体Tag)。void设置装备时使用的相机覆盖层键。voidsetCanBeSheared(boolean sheared) 设置物品是否会被剪刀剪掉。voidsetDamageOnHurt(boolean damage) 设置当穿戴实体受到伤害时物品是否会受损。voidsetDispensable(boolean dispensable) 设置物品是否可以被发射器装备。voidsetEquipOnInteract(boolean equip) 设置物品是否会在交互时装备。voidsetEquipSound(@Nullable Sound sound) 设置装备物品时播放的音效。void设置装备时使用的模型键。voidsetShearingSound(@Nullable Sound sound) 设置物品被剪时播放的音效。voidsetSlot(@NotNull EquipmentSlot slot) 设置物品可以装备到的槽位。voidsetSwappable(boolean swappable) 设置物品是否可以通过右键交换。从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
方法详细资料
-
getSlot
获取物品可以装备到的槽位。原文:Gets the slot the item can be equipped to.
- 返回:
- 槽位
-
setSlot
设置物品可以装备到的槽位。原文:Sets the slot the item can be equipped to.
- 参数:
slot- 新的槽位
-
getEquipSound
获取装备物品时播放的音效。原文:Gets the sound to play when the item is equipped.
- 返回:
- 音效
-
setEquipSound
设置装备物品时播放的音效。原文:Sets the sound to play when the item is equipped.
- 参数:
sound- 音效或null表示使用当前默认值
-
getModel
获取装备时使用的模型键。原文:Gets the key of the model to use when equipped.
- 返回:
- 模型键
-
setModel
设置装备时使用的模型键。原文:Sets the key of the model to use when equipped.
- 参数:
key- 模型键
-
getCameraOverlay
获取装备时使用的相机覆盖层键。原文:Gets the key of the camera overlay to use when equipped.
- 返回:
- 相机覆盖层键
-
setCameraOverlay
设置装备时使用的相机覆盖层键。原文:Sets the key of the camera overlay to use when equipped.
- 参数:
key- 相机覆盖层键
-
getAllowedEntities
获取可以装备此物品的实体。原文:Gets the entities which can equip this item.
- 返回:
- 实体集合
-
setAllowedEntities
设置可以装备此物品的实体。原文:Sets the entities which can equip this item.
- 参数:
entities- 实体类型
-
setAllowedEntities
设置可以装备此物品的实体。原文:Sets the entities which can equip this item.
- 参数:
entities- 实体类型
-
setAllowedEntities
设置可以装备此物品的实体类型(表示为实体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
获取物品被剪时播放的音效。原文:Gets the sound to play when the item is sheared.
- 返回:
- 音效
-
setShearingSound
设置物品被剪时播放的音效。原文:Sets the sound to play when the item is sheared.
- 参数:
sound- 音效或null表示使用当前默认值
-