接口 EntityEquipment
-
方法概要
修饰符和类型方法说明void
clear()
清除实体所有的盔甲和手持的物品.获得实体当前所有穿着盔甲的拷贝.getBoots()
获取该实体当前正在穿戴的鞋子的拷贝.float
获得该生物在死亡时掉落其鞋子的几率.获取该实体当前正在穿戴的胸甲的拷贝.float
获得该生物在死亡时掉落其胸甲的几率.获取该实体当前正在佩戴的头盔的拷贝.float
获得该生物在死亡时掉落其头盔的几率.获取此EntityEquipment所属的实体.getItem
(@NotNull EquipmentSlot slot) Gets the ItemStack at the given equipment slot in the inventory.已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手float
已过时。现在实体可以双持, 所以需要特定的方法来设置指定的手获取实体当前主手中手持的物品的拷贝.float
获得该生物在死亡时掉落其主手的物品的几率.获取实体当前副手中手持的物品的拷贝.float
获得该生物在死亡时掉落其副手的物品的几率.获取该实体当前正在穿戴的护腿的拷贝.float
获得该生物在死亡时掉落其护腿的几率.void
setArmorContents
(@NotNull ItemStack[] items) 将实体所穿戴的盔甲设置为提供的ItemStacks数组.void
设置该实体当前正在穿戴的鞋子.void
设置该实体当前正在穿戴的鞋子.void
setBootsDropChance
(float chance) 设置该生物在死亡时掉落其鞋子的几率.void
setChestplate
(@Nullable ItemStack chestplate) 设置该实体当前正在穿戴的胸甲.void
setChestplate
(@Nullable ItemStack chestplate, boolean silent) 设置该实体当前正在穿戴的胸甲.void
setChestplateDropChance
(float chance) 设置该生物在死亡时掉落其胸甲的几率.void
设置该实体当前正在佩戴的头盔.void
设置该实体当前正在佩戴的头盔.void
setHelmetDropChance
(float chance) 设置该生物在死亡时掉落其头盔的几率.void
setItem
(@NotNull EquipmentSlot slot, @Nullable ItemStack item) Stores the ItemStack at the given equipment slot in the inventory.void
setItem
(@NotNull EquipmentSlot slot, @Nullable ItemStack item, boolean silent) Stores the ItemStack at the given equipment slot in the inventory.void
setItemInHand
(@Nullable ItemStack stack) 已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手void
setItemInHandDropChance
(float chance) 已过时。现在实体可以双持, 所以需要特定的方法来设置指定的手void
设置实体在主手中手持的物品.void
setItemInMainHand
(@Nullable ItemStack item, boolean silent) 设置实体在主手中手持的物品.void
setItemInMainHandDropChance
(float chance) 设置该生物在死亡时掉落其主手的物品的几率.void
设置实体在副手中手持的物品.void
setItemInOffHand
(@Nullable ItemStack item, boolean silent) 设置实体在副手中手持的物品.void
setItemInOffHandDropChance
(float chance) 设置该生物在死亡时掉落其副手的物品的几率.void
setLeggings
(@Nullable ItemStack leggings) 设置该实体当前正在穿戴的护腿.void
setLeggings
(@Nullable ItemStack leggings, boolean silent) 设置该实体当前正在穿戴的护腿.void
setLeggingsDropChance
(float chance) 设置该生物在死亡时掉落其护腿的几率.
-
方法详细资料
-
setItem
Stores the ItemStack at the given equipment slot in the inventory.- 参数:
slot
- the slot to put the ItemStackitem
- the ItemStack to set
-
setItem
void setItem(@NotNull @NotNull EquipmentSlot slot, @Nullable @Nullable ItemStack item, boolean silent) Stores the ItemStack at the given equipment slot in the inventory.- 参数:
slot
- the slot to put the ItemStackitem
- the ItemStack to setsilent
- whether or not the equip sound should be silenced
-
getItem
Gets the ItemStack at the given equipment slot in the inventory.- 参数:
slot
- the slot to get the ItemStack- 返回:
- the ItemStack in the given slot
-
getItemInMainHand
获取实体当前主手中手持的物品的拷贝.原文: Gets a copy of the item the entity is currently holding in their main hand.
- 返回:
- 当前主手手持的物品
-
setItemInMainHand
设置实体在主手中手持的物品.原文: Sets the item the entity is holding in their main hand.
- 参数:
item
- 需要设置的物品
-
setItemInMainHand
设置实体在主手中手持的物品.原文:Sets the item the entity is holding in their main hand.
- 参数:
item
- 需要设置的物品silent
- 是否播放装备动作的声音
-
getItemInOffHand
获取实体当前副手中手持的物品的拷贝.原文: Gets a copy of the item the entity is currently holding in their off hand.
- 返回:
- 当前副手手持的物品
-
setItemInOffHand
设置实体在副手中手持的物品.原文: Sets the item the entity is holding in their off hand.
- 参数:
item
- 需要设置的物品
-
setItemInOffHand
设置实体在副手中手持的物品.原文: Sets the item the entity is holding in their off hand.
- 参数:
item
- 需要设置的物品silent
- 是否播放装备动作的声音
-
getItemInHand
已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手获取实体当前所持物品的拷贝.译注: 反编译其实现, 发现其也是获取主手的物品.
原文: Gets a copy of the item the entity is currently holding
- 返回:
- the currently held item
- 另请参阅:
-
setItemInHand
已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手设置实体当前所持的物品.译注: 反编译其实现, 发现其也是设置主手的物品.
原文: Sets the item the entity is holding
- 参数:
stack
- 需要设置的物品- 另请参阅:
-
getHelmet
获取该实体当前正在佩戴的头盔的拷贝.原文: Gets a copy of the helmet currently being worn by the entity
- 返回:
- 所佩戴的头盔
-
setHelmet
设置该实体当前正在佩戴的头盔.原文: Sets the helmet worn by the entity
- 参数:
helmet
- 给定的头盔
-
setHelmet
设置该实体当前正在佩戴的头盔.原文: Sets the helmet worn by the entity
- 参数:
helmet
- 给定的头盔silent
- 是否播放装备动作的声音
-
getChestplate
获取该实体当前正在穿戴的胸甲的拷贝.原文: Gets a copy of the chest plate currently being worn by the entity
- 返回:
- 实体所穿戴的胸甲
-
setChestplate
设置该实体当前正在穿戴的胸甲.原文: Sets the chest plate worn by the entity
- 参数:
chestplate
- 给定的胸甲
-
setChestplate
设置该实体当前正在穿戴的胸甲.原文: Sets the chest plate worn by the entity
- 参数:
chestplate
- 给定的胸甲silent
- 是否播放装备动作的声音
-
getLeggings
获取该实体当前正在穿戴的护腿的拷贝.原文: Gets a copy of the leggings currently being worn by the entity
- 返回:
- 实体所穿戴的护腿
-
setLeggings
设置该实体当前正在穿戴的护腿.原文: Sets the leggings worn by the entity
- 参数:
leggings
- 给定的护腿
-
setLeggings
设置该实体当前正在穿戴的护腿.原文: Sets the leggings worn by the entity
- 参数:
leggings
- 给定的护腿silent
- 是否播放装备动作的声音
-
getBoots
获取该实体当前正在穿戴的鞋子的拷贝.原文: Gets a copy of the boots currently being worn by the entity
- 返回:
- 实体所穿戴的鞋子
-
setBoots
设置该实体当前正在穿戴的鞋子.原文: Sets the boots worn by the entity
- 参数:
boots
- 给定的鞋子
-
setBoots
设置该实体当前正在穿戴的鞋子.原文: Sets the boots worn by the entity
- 参数:
boots
- 给定的鞋子silent
- 是否播放装备动作的声音
-
getArmorContents
获得实体当前所有穿着盔甲的拷贝.译注: 其顺序为 鞋子、护腿、胸甲、头盔.
原文: Gets all ItemStacks from the armor slots.
- 返回:
- all the ItemStacks from the armor slots. Individual items can be null and are returned in a fixed order starting from the boots and going up to the helmet
-
setArmorContents
将实体所穿戴的盔甲设置为提供的ItemStacks数组.译注:
- 该ItemStack数组的顺序应为 鞋子、护腿、胸甲、头盔
- 当数组长度不够4个时, 将会把剩下的设置为null, 如为2时,胸甲和头盔将会自动设置为null
原文: Sets the entities armor to the provided array of ItemStacks
- 参数:
items
- 给定的盔甲数组. 个别条目可以为null
-
clear
void clear()清除实体所有的盔甲和手持的物品.原文: Clears the entity of all armor and held items
-
getItemInHandDropChance
已过时。现在实体可以双持, 所以需要特定的方法来设置指定的手- 返回:
- 掉落的几率
- 另请参阅:
-
setItemInHandDropChance
已过时。现在实体可以双持, 所以需要特定的方法来设置指定的手- 参数:
chance
- 给定的掉落几率- 另请参阅:
-
getItemInMainHandDropChance
float getItemInMainHandDropChance()获得该生物在死亡时掉落其主手的物品的几率.原文: Gets the chance of the main hand item being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落主手物品的几率(在原版里, 对于非
Mob
类实体来说是1.0F)
-
setItemInMainHandDropChance
void setItemInMainHandDropChance(float chance) 设置该生物在死亡时掉落其主手的物品的几率.原文: Sets the chance of the item this creature is currently holding in their main hand being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 参数:
chance
- 主手掉落物品的几率- 抛出:
UnsupportedOperationException
- 当这一操作作用在非Mob
类实体时抛出此异常
-
getItemInOffHandDropChance
float getItemInOffHandDropChance()获得该生物在死亡时掉落其副手的物品的几率.原文: Gets the chance of the off hand item being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落副手物品的几率(在原版里, 对于非
Mob
类实体来说是1.0F)
-
setItemInOffHandDropChance
void setItemInOffHandDropChance(float chance) 设置该生物在死亡时掉落其副手的物品的几率.原文: Sets the chance of the off hand item being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 参数:
chance
- 副手掉落物品的几率- 抛出:
UnsupportedOperationException
- 当这一操作作用在非Mob
类实体时抛出此异常
-
getHelmetDropChance
float getHelmetDropChance()获得该生物在死亡时掉落其头盔的几率.原文: Gets the chance of the helmet being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落头盔的几率(在原版里, 对于非
Mob
类实体来说是1.0F)
-
setHelmetDropChance
void setHelmetDropChance(float chance) 设置该生物在死亡时掉落其头盔的几率.原文: Sets the chance of the helmet being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 参数:
chance
- 掉落头盔的几率- 抛出:
UnsupportedOperationException
- 当这一操作作用在非Mob
类实体时抛出此异常
-
getChestplateDropChance
float getChestplateDropChance()获得该生物在死亡时掉落其胸甲的几率.原文: Gets the chance of the chest plate being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落胸甲的几率(在原版里, 对于非
Mob
类实体来说是1.0F)
-
setChestplateDropChance
void setChestplateDropChance(float chance) 设置该生物在死亡时掉落其胸甲的几率.原文: Sets the chance of the chest plate being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 参数:
chance
- 掉落胸甲的几率- 抛出:
UnsupportedOperationException
- 当这一操作作用在非Mob
类实体时抛出此异常
-
getLeggingsDropChance
float getLeggingsDropChance()获得该生物在死亡时掉落其护腿的几率.原文: Gets the chance of the leggings being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落护腿的几率(在原版里, 对于非
Mob
类实体来说是1.0F)
-
setLeggingsDropChance
void setLeggingsDropChance(float chance) 设置该生物在死亡时掉落其护腿的几率.原文: Sets the chance of the leggings being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 参数:
chance
- 掉落护腿的几率- 抛出:
UnsupportedOperationException
- 当这一操作作用在非Mob
类实体时抛出此异常
-
getBootsDropChance
float getBootsDropChance()获得该生物在死亡时掉落其鞋子的几率.原文: Gets the chance of the boots being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落鞋子的几率(在原版里, 对于非
Mob
类实体来说是1.0F)
-
setBootsDropChance
void setBootsDropChance(float chance) 设置该生物在死亡时掉落其鞋子的几率.原文: Sets the chance of the boots being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 参数:
chance
- 掉落鞋子的几率- 抛出:
UnsupportedOperationException
- 当这一操作作用在非Mob
类实体时抛出此异常
-
getHolder
获取此EntityEquipment所属的实体.原文: Get the entity this EntityEquipment belongs to
- 返回:
- 这个EntityEquipment所属的实体
-