接口 EntityEquipment
-
方法概要
修饰符和类型方法说明voidclear()清除实体所有的盔甲和手持的物品获得实体当前所有穿着盔甲的拷贝getBoots()获取该实体当前正在穿戴的鞋子的拷贝float获得该生物在死亡时掉落其鞋子的几率获取该实体当前正在穿戴的胸甲的拷贝float获得该生物在死亡时掉落其胸甲的几率获取该实体当前正在佩戴的头盔的拷贝float获得该生物在死亡时掉落其头盔的几率获取此EntityEquipment所属的实体已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手float已过时。现在实体可以双持, 所以需要特定的方法来设置指定的手获取实体当前主手中手持的物品的拷贝float获得该生物在死亡时掉落其主手的物品的几率获取实体当前副手中手持的物品的拷贝float获得该生物在死亡时掉落其副手的物品的几率获取该实体当前正在穿戴的护腿的拷贝float获得该生物在死亡时掉落其护腿的几率voidsetArmorContents(ItemStack[] items) 将实体所穿戴的盔甲设置为提供的ItemStacks数组void设置该实体当前正在穿戴的鞋子voidsetBootsDropChance(float chance) 设置该生物在死亡时掉落其鞋子的几率voidsetChestplate(ItemStack chestplate) 设置该实体当前正在穿戴的胸甲voidsetChestplateDropChance(float chance) 设置该生物在死亡时掉落其胸甲的几率void设置该实体当前正在佩戴的头盔voidsetHelmetDropChance(float chance) 设置该生物在死亡时掉落其头盔的几率voidsetItemInHand(ItemStack stack) 已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手voidsetItemInHandDropChance(float chance) 已过时。现在实体可以双持, 所以需要特定的方法来设置指定的手voidsetItemInMainHand(ItemStack item) 设置实体在主手中手持的物品voidsetItemInMainHandDropChance(float chance) 设置该生物在死亡时掉落其主手的物品的几率voidsetItemInOffHand(ItemStack item) 设置实体在副手中手持的物品voidsetItemInOffHandDropChance(float chance) 设置该生物在死亡时掉落其副手的物品的几率voidsetLeggings(ItemStack leggings) 设置该实体当前正在穿戴的护腿voidsetLeggingsDropChance(float chance) 设置该生物在死亡时掉落其护腿的几率
-
方法详细资料
-
getItemInMainHand
ItemStack 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- 需要设置的物品
-
getItemInOffHand
ItemStack 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- 需要设置的物品
-
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
ItemStack getHelmet()获取该实体当前正在佩戴的头盔的拷贝原文: Gets a copy of the helmet currently being worn by the entity
- 返回:
- 所佩戴的头盔
-
setHelmet
设置该实体当前正在佩戴的头盔原文: Sets the helmet worn by the entity
- 参数:
helmet- 给定的头盔
-
getChestplate
ItemStack getChestplate()获取该实体当前正在穿戴的胸甲的拷贝原文: Gets a copy of the chest plate currently being worn by the entity
- 返回:
- 实体所穿戴的胸甲
-
setChestplate
设置该实体当前正在穿戴的胸甲原文: Sets the chest plate worn by the entity
- 参数:
chestplate- 给定的胸甲
-
getLeggings
ItemStack getLeggings()获取该实体当前正在穿戴的护腿的拷贝原文: Gets a copy of the leggings currently being worn by the entity
- 返回:
- 实体所穿戴的护腿
-
setLeggings
设置该实体当前正在穿戴的护腿原文: Sets the leggings worn by the entity
- 参数:
leggings- 给定的护腿
-
getBoots
ItemStack getBoots()获取该实体当前正在穿戴的鞋子的拷贝原文: Gets a copy of the boots currently being worn by the entity
- 返回:
- 实体所穿戴的鞋子
-
setBoots
设置该实体当前正在穿戴的鞋子原文: Sets the boots worn by the entity
- 参数:
boots- 给定的鞋子
-
getArmorContents
ItemStack[] getArmorContents()获得实体当前所有穿着盔甲的拷贝译注: 其顺序为 鞋子、护腿、胸甲、头盔
原文: Gets a copy of all worn armor
- 返回:
- 一个关于实体当前所有穿着的盔甲的数组
-
setArmorContents
将实体所穿戴的盔甲设置为提供的ItemStacks数组译注:
- 该ItemStack数组的顺序应为 鞋子、护腿、胸甲、头盔
- 当数组长度不够4个时, 将会把剩下的设置为null, 如为2时,胸甲和头盔将会自动设置为null
原文: Sets the entities armor to the provided array of ItemStacks
- 参数:
items- 给定的盔甲数组
-
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时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落主手物品的几率(在原版里, 对于玩家来说是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- 当这一操作作用在玩家时抛出此异常
-
getItemInOffHandDropChance
float getItemInOffHandDropChance()获得该生物在死亡时掉落其副手的物品的几率原文: Gets the chance of the off hand item being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落副手物品的几率(在原版里, 对于玩家来说是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- 当这一操作作用在玩家时抛出此异常
-
getHelmetDropChance
float getHelmetDropChance()获得该生物在死亡时掉落其头盔的几率原文: Gets the chance of the helmet being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落头盔的几率(在原版里, 对于玩家来说是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- 当这一操作作用在玩家时抛出此异常
-
getChestplateDropChance
float getChestplateDropChance()获得该生物在死亡时掉落其胸甲的几率原文: Gets the chance of the chest plate being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落胸甲的几率(在原版里, 对于玩家来说是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- 当这一操作作用在玩家时抛出此异常
-
getLeggingsDropChance
float getLeggingsDropChance()获得该生物在死亡时掉落其护腿的几率原文: Gets the chance of the leggings being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落护腿的几率(在原版里, 对于玩家来说是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- 当这一操作作用在玩家时抛出此异常
-
getBootsDropChance
float getBootsDropChance()获得该生物在死亡时掉落其鞋子的几率原文: Gets the chance of the boots being dropped upon this creature's death.
- 当掉落几率为0.0F时, 则永远不会掉落
- 当掉落几率为1.0F时, 则总是会掉落
- 返回:
- 当前生物在死亡时掉落鞋子的几率(在原版里, 对于玩家来说是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- 当这一操作作用在玩家时抛出此异常
-
getHolder
Entity getHolder()获取此EntityEquipment所属的实体原文: Get the entity this EntityEquipment belongs to
- 返回:
- 这个EntityEquipment所属的实体
-