Package com.loohp.limbo.entity
Interface EntityEquipment
- All Known Implementing Classes:
PlayerInventory
,StandardEntityEquipment
public interface EntityEquipment
An interface to a creatures inventory
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the entity of all armor and held itemsGets a copy of all worn armorgetBoots()
Gets a copy of the boots currently being worn by the entityGets a copy of the chest plate currently being worn by the entityGets a copy of the helmet currently being worn by the entityGet the entity this EntityEquipment belongs togetItem
(EquipmentSlot slot) Gets the ItemStack at the given equipment slot in the inventory.Gets a copy of the item the entity is currently holding in their main hand.Gets a copy of the item the entity is currently holding in their off hand.Gets a copy of the leggings currently being worn by the entityvoid
setArmorContents
(ItemStack[] items) Sets the entities armor to the provided array of ItemStacksvoid
Sets the boots worn by the entityvoid
setChestplate
(ItemStack chestplate) Sets the chest plate worn by the entityvoid
Sets the helmet worn by the entityvoid
setItem
(EquipmentSlot slot, ItemStack item) Stores the ItemStack at the given equipment slot in the inventory.void
setItemInMainHand
(ItemStack item) Sets the item the entity is holding in their main hand.void
setItemInOffHand
(ItemStack item) Sets the item the entity is holding in their off hand.void
setLeggings
(ItemStack leggings) Sets the leggings worn by the entity
-
Method Details
-
setItem
Stores the ItemStack at the given equipment slot in the inventory.- Parameters:
slot
- the slot to put the ItemStackitem
- the ItemStack to set
-
getItem
Gets the ItemStack at the given equipment slot in the inventory.- Parameters:
slot
- the slot to get the ItemStack- Returns:
- the ItemStack in the given slot
-
getItemInMainHand
ItemStack getItemInMainHand()Gets a copy of the item the entity is currently holding in their main hand.- Returns:
- the currently held item
-
setItemInMainHand
Sets the item the entity is holding in their main hand.- Parameters:
item
- The item to put into the entities hand
-
getItemInOffHand
ItemStack getItemInOffHand()Gets a copy of the item the entity is currently holding in their off hand.- Returns:
- the currently held item
-
setItemInOffHand
Sets the item the entity is holding in their off hand.- Parameters:
item
- 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. Individual items may be null.
-
setArmorContents
Sets the entities armor to the provided array of ItemStacks- Parameters:
items
- The items to set the armor as. Individual items may be null.
-
clear
void clear()Clears the entity of all armor and held items -
getHolder
Entity getHolder()Get the entity this EntityEquipment belongs to- Returns:
- the entity this EntityEquipment belongs to
-