Package org.bukkit.inventory
Interface EntityEquipment
public interface EntityEquipment
An interface to a creatures inventory
-
Method Summary
Modifier and Type Method Description voidclear()Clears the entity of all armor and held itemsItemStack[]getArmorContents()Gets a copy of all worn armorItemStackgetBoots()Gets a copy of the boots currently being worn by the entityfloatgetBootsDropChance()Gets the chance of the boots being dropped upon this creature's death.ItemStackgetChestplate()Gets a copy of the chest plate currently being worn by the entityfloatgetChestplateDropChance()Gets the chance of the chest plate being dropped upon this creature's death.ItemStackgetHelmet()Gets a copy of the helmet currently being worn by the entityfloatgetHelmetDropChance()Gets the chance of the helmet being dropped upon this creature's death.EntitygetHolder()Get the entity this EntityEquipment belongs toItemStackgetItemInHand()Gets a copy of the item the entity is currently holdingfloatgetItemInHandDropChance()Gets the chance of the currently held item being dropped upon this creature's death.ItemStackgetLeggings()Gets a copy of the leggings currently being worn by the entityfloatgetLeggingsDropChance()Gets the chance of the leggings being dropped upon this creature's death.voidsetArmorContents(ItemStack[] items)Sets the entities armor to the provided array of ItemStacksvoidsetBoots(ItemStack boots)Sets the boots worn by the entityvoidsetBootsDropChance(float chance)Sets the chance of the boots being dropped upon this creature's death.voidsetChestplate(ItemStack chestplate)Sets the chest plate worn by the entityvoidsetChestplateDropChance(float chance)Sets the chance of the chest plate being dropped upon this creature's death.voidsetHelmet(ItemStack helmet)Sets the helmet worn by the entityvoidsetHelmetDropChance(float chance)Sets the chance of the helmet being dropped upon this creature's death.voidsetItemInHand(ItemStack stack)Sets the item the entity is holdingvoidsetItemInHandDropChance(float chance)Sets the chance of the item this creature is currently holding being dropped upon this creature's death.voidsetLeggings(ItemStack leggings)Sets the leggings worn by the entityvoidsetLeggingsDropChance(float chance)Sets the chance of the leggings being dropped upon this creature's death.
-
Method Details
-
getItemInHand
ItemStack getItemInHand()Gets a copy of the item the entity is currently holding- Returns:
- the currently held item
-
setItemInHand
Sets the item the entity is holding- Parameters:
stack- The item to put into the entities hand
-
getHelmet
ItemStack getHelmet()Gets a copy of the helmet currently being worn by the entity- Returns:
- The helmet being worn
-
setHelmet
Sets the helmet worn by the entity- Parameters:
helmet- The helmet to put on the entity
-
getChestplate
ItemStack getChestplate()Gets a copy of the chest plate currently being worn by the entity- Returns:
- The chest plate being worn
-
setChestplate
Sets the chest plate worn by the entity- Parameters:
chestplate- The chest plate to put on the entity
-
getLeggings
ItemStack getLeggings()Gets a copy of the leggings currently being worn by the entity- Returns:
- The leggings being worn
-
setLeggings
Sets the leggings worn by the entity- Parameters:
leggings- The leggings to put on the entity
-
getBoots
ItemStack getBoots()Gets a copy of the boots currently being worn by the entity- Returns:
- The boots being worn
-
setBoots
Sets the boots worn by the entity- Parameters:
boots- The boots to put on the entity
-
getArmorContents
ItemStack[] getArmorContents()Gets a copy of all worn armor- Returns:
- The array of worn armor
-
setArmorContents
Sets the entities armor to the provided array of ItemStacks- Parameters:
items- The items to set the armor as
-
clear
void clear()Clears the entity of all armor and held items -
getItemInHandDropChance
float getItemInHandDropChance()Gets the chance of the currently held item being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Returns:
- chance of the currently held item being dropped (1 for players)
-
setItemInHandDropChance
void setItemInHandDropChance(float chance)Sets the chance of the item this creature is currently holding being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Parameters:
chance- the chance of the currently held item being dropped- Throws:
java.lang.UnsupportedOperationException- when called on players
-
getHelmetDropChance
float getHelmetDropChance()Gets the chance of the helmet being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Returns:
- the chance of the helmet being dropped (1 for players)
-
setHelmetDropChance
void setHelmetDropChance(float chance)Sets the chance of the helmet being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Parameters:
chance- of the helmet being dropped- Throws:
java.lang.UnsupportedOperationException- when called on players
-
getChestplateDropChance
float getChestplateDropChance()Gets the chance of the chest plate being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Returns:
- the chance of the chest plate being dropped (1 for players)
-
setChestplateDropChance
void setChestplateDropChance(float chance)Sets the chance of the chest plate being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Parameters:
chance- of the chest plate being dropped- Throws:
java.lang.UnsupportedOperationException- when called on players
-
getLeggingsDropChance
float getLeggingsDropChance()Gets the chance of the leggings being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Returns:
- the chance of the leggings being dropped (1 for players)
-
setLeggingsDropChance
void setLeggingsDropChance(float chance)Sets the chance of the leggings being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Parameters:
chance- chance of the leggings being dropped- Throws:
java.lang.UnsupportedOperationException- when called on players
-
getBootsDropChance
float getBootsDropChance()Gets the chance of the boots being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Returns:
- the chance of the boots being dropped (1 for players)
-
setBootsDropChance
void setBootsDropChance(float chance)Sets the chance of the boots being dropped upon this creature's death.- A drop chance of 0F will never drop
- A drop chance of 1F will always drop
- Parameters:
chance- of the boots being dropped- Throws:
java.lang.UnsupportedOperationException- when called on players
-
getHolder
Entity getHolder()Get the entity this EntityEquipment belongs to- Returns:
- the entity this EntityEquipment belongs to
-