public interface EntityEquipment
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the entity of all armor and held items
|
@NotNull ItemStack[] |
getArmorContents()
Gets a copy of all worn armor
|
@Nullable ItemStack |
getBoots()
Gets a copy of the boots currently being worn by the entity
|
float |
getBootsDropChance()
Gets the chance of the boots being dropped upon this creature's death.
|
@Nullable ItemStack |
getChestplate()
Gets a copy of the chest plate currently being worn by the entity
|
float |
getChestplateDropChance()
Gets the chance of the chest plate being dropped upon this creature's
death.
|
float |
getDropChance(@NotNull EquipmentSlot slot)
Gets the drop chance of specified slot.
|
@Nullable ItemStack |
getHelmet()
Gets a copy of the helmet currently being worn by the entity
|
float |
getHelmetDropChance()
Gets the chance of the helmet being dropped upon this creature's death.
|
@Nullable Entity |
getHolder()
Get the entity this EntityEquipment belongs to
|
@NotNull ItemStack |
getItem(@NotNull EquipmentSlot slot)
Gets the ItemStack at the given equipment slot in the inventory.
|
@NotNull ItemStack |
getItemInHand()
Deprecated.
entities can duel wield now use the methods for the
specific hand instead
|
float |
getItemInHandDropChance()
Deprecated.
entities can duel wield now use the methods for the specific
hand instead
|
@NotNull ItemStack |
getItemInMainHand()
Gets a copy of the item the entity is currently holding
in their main hand.
|
float |
getItemInMainHandDropChance()
Gets the chance of the main hand item being dropped upon this creature's
death.
|
@NotNull ItemStack |
getItemInOffHand()
Gets a copy of the item the entity is currently holding
in their off hand.
|
float |
getItemInOffHandDropChance()
Gets the chance of the off hand item being dropped upon this creature's
death.
|
@Nullable ItemStack |
getLeggings()
Gets a copy of the leggings currently being worn by the entity
|
float |
getLeggingsDropChance()
Gets the chance of the leggings being dropped upon this creature's
death.
|
void |
setArmorContents(@NotNull ItemStack[] items)
Sets the entities armor to the provided array of ItemStacks
|
void |
setBoots(@Nullable ItemStack boots)
Sets the boots worn by the entity
|
void |
setBoots(@Nullable ItemStack boots,
boolean silent)
Sets the boots worn by the entity
|
void |
setBootsDropChance(float chance)
Sets the chance of the boots being dropped upon this creature's death.
|
void |
setChestplate(@Nullable ItemStack chestplate)
Sets the chest plate worn by the entity
|
void |
setChestplate(@Nullable ItemStack chestplate,
boolean silent)
Sets the chest plate worn by the entity
|
void |
setChestplateDropChance(float chance)
Sets the chance of the chest plate being dropped upon this creature's
death.
|
void |
setDropChance(@NotNull EquipmentSlot slot,
float chance)
Sets the drop chance of the specified slot.
|
void |
setHelmet(@Nullable ItemStack helmet)
Sets the helmet worn by the entity
|
void |
setHelmet(@Nullable ItemStack helmet,
boolean silent)
Sets the helmet worn by the entity
|
void |
setHelmetDropChance(float chance)
Sets the chance of the helmet being dropped upon this creature's death.
|
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)
Deprecated.
entities can duel wield now use the methods for the
specific hand instead
|
void |
setItemInHandDropChance(float chance)
Deprecated.
entities can duel wield now use the methods for the specific
hand instead
|
void |
setItemInMainHand(@Nullable ItemStack item)
Sets the item the entity is holding in their main hand.
|
void |
setItemInMainHand(@Nullable ItemStack item,
boolean silent)
Sets the item the entity is holding in their main hand.
|
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.
|
void |
setItemInOffHand(@Nullable ItemStack item)
Sets the item the entity is holding in their off hand.
|
void |
setItemInOffHand(@Nullable ItemStack item,
boolean silent)
Sets the item the entity is holding in their off hand.
|
void |
setItemInOffHandDropChance(float chance)
Sets the chance of the off hand item being dropped upon this creature's
death.
|
void |
setLeggings(@Nullable ItemStack leggings)
Sets the leggings worn by the entity
|
void |
setLeggings(@Nullable ItemStack leggings,
boolean silent)
Sets the leggings worn by the entity
|
void |
setLeggingsDropChance(float chance)
Sets the chance of the leggings being dropped upon this creature's
death.
|
void setItem(@NotNull @NotNull EquipmentSlot slot, @Nullable @Nullable ItemStack item)
slot
- the slot to put the ItemStackitem
- the ItemStack to setvoid setItem(@NotNull @NotNull EquipmentSlot slot, @Nullable @Nullable ItemStack item, boolean silent)
slot
- the slot to put the ItemStackitem
- the ItemStack to setsilent
- whether or not the equip sound should be silenced@NotNull @NotNull ItemStack getItem(@NotNull @NotNull EquipmentSlot slot)
slot
- the slot to get the ItemStack@NotNull @NotNull ItemStack getItemInMainHand()
void setItemInMainHand(@Nullable @Nullable ItemStack item)
item
- The item to put into the entities handvoid setItemInMainHand(@Nullable @Nullable ItemStack item, boolean silent)
item
- The item to put into the entities handsilent
- whether or not the equip sound should be silenced@NotNull @NotNull ItemStack getItemInOffHand()
void setItemInOffHand(@Nullable @Nullable ItemStack item)
item
- The item to put into the entities handvoid setItemInOffHand(@Nullable @Nullable ItemStack item, boolean silent)
item
- The item to put into the entities handsilent
- whether or not the equip sound should be silenced@Deprecated @NotNull @NotNull ItemStack getItemInHand()
getItemInMainHand()
,
getItemInOffHand()
@Deprecated void setItemInHand(@Nullable @Nullable ItemStack stack)
stack
- The item to put into the entities handsetItemInMainHand(ItemStack)
,
setItemInOffHand(ItemStack)
@Nullable @Nullable ItemStack getHelmet()
void setHelmet(@Nullable @Nullable ItemStack helmet)
helmet
- The helmet to put on the entityvoid setHelmet(@Nullable @Nullable ItemStack helmet, boolean silent)
helmet
- The helmet to put on the entitysilent
- whether or not the equip sound should be silenced@Nullable @Nullable ItemStack getChestplate()
void setChestplate(@Nullable @Nullable ItemStack chestplate)
chestplate
- The chest plate to put on the entityvoid setChestplate(@Nullable @Nullable ItemStack chestplate, boolean silent)
chestplate
- The chest plate to put on the entitysilent
- whether or not the equip sound should be silenced@Nullable @Nullable ItemStack getLeggings()
void setLeggings(@Nullable @Nullable ItemStack leggings)
leggings
- The leggings to put on the entityvoid setLeggings(@Nullable @Nullable ItemStack leggings, boolean silent)
leggings
- The leggings to put on the entitysilent
- whether or not the equip sound should be silenced@Nullable @Nullable ItemStack getBoots()
void setBoots(@Nullable @Nullable ItemStack boots)
boots
- The boots to put on the entityvoid setBoots(@Nullable @Nullable ItemStack boots, boolean silent)
boots
- The boots to put on the entitysilent
- whether or not the equip sound should be silenced@NotNull @NotNull ItemStack[] getArmorContents()
void setArmorContents(@NotNull @NotNull ItemStack[] items)
items
- The items to set the armor as. Individual items may be null.void clear()
@Deprecated float getItemInHandDropChance()
getItemInMainHandDropChance()
,
getItemInOffHandDropChance()
@Deprecated void setItemInHandDropChance(float chance)
chance
- drop chancesetItemInMainHandDropChance(float)
,
setItemInOffHandDropChance(float)
float getItemInMainHandDropChance()
void setItemInMainHandDropChance(float chance)
chance
- the chance of the main hand item being droppedUnsupportedOperationException
- when called on playersfloat getItemInOffHandDropChance()
void setItemInOffHandDropChance(float chance)
chance
- the chance of off hand item being droppedUnsupportedOperationException
- when called on playersfloat getHelmetDropChance()
void setHelmetDropChance(float chance)
chance
- of the helmet being droppedUnsupportedOperationException
- when called on playersfloat getChestplateDropChance()
void setChestplateDropChance(float chance)
chance
- of the chest plate being droppedUnsupportedOperationException
- when called on playersfloat getLeggingsDropChance()
void setLeggingsDropChance(float chance)
chance
- chance of the leggings being droppedUnsupportedOperationException
- when called on playersfloat getBootsDropChance()
void setBootsDropChance(float chance)
chance
- of the boots being droppedUnsupportedOperationException
- when called on players@Nullable @Nullable Entity getHolder()
float getDropChance(@NotNull @NotNull EquipmentSlot slot)
slot
- the slot to get the drop chance ofvoid setDropChance(@NotNull @NotNull EquipmentSlot slot, float chance)
slot
- the slot to set the drop chance ofchance
- the drop chance for the slotUnsupportedOperationException
- when called on playersCopyright © 2021. All rights reserved.