Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.inventory.PlayerInventory Interface Reference
Inheritance diagram for org.bukkit.inventory.PlayerInventory:
org.bukkit.inventory.Inventory

Public Member Functions

ItemStack[] getArmorContents ()
 
ItemStack getHelmet ()
 
ItemStack getChestplate ()
 
ItemStack getLeggings ()
 
ItemStack getBoots ()
 
void setArmorContents (ItemStack[] items)
 
void setHelmet (ItemStack helmet)
 
void setChestplate (ItemStack chestplate)
 
void setLeggings (ItemStack leggings)
 
void setBoots (ItemStack boots)
 
ItemStack getItemInHand ()
 
void setItemInHand (ItemStack stack)
 
int getHeldItemSlot ()
 
void setHeldItemSlot (int slot)
 
int clear (int id, int data)
 
HumanEntity getHolder ()
 
- Public Member Functions inherited from org.bukkit.inventory.Inventory
int getSize ()
 
int getMaxStackSize ()
 
void setMaxStackSize (int size)
 
String getName ()
 
ItemStack getItem (int index)
 
void setItem (int index, ItemStack item)
 
HashMap< Integer, ItemStackaddItem (ItemStack...items) throws IllegalArgumentException
 
HashMap< Integer, ItemStackremoveItem (ItemStack...items) throws IllegalArgumentException
 
ItemStack[] getContents ()
 
void setContents (ItemStack[] items) throws IllegalArgumentException
 
boolean contains (int materialId)
 
boolean contains (Material material) throws IllegalArgumentException
 
boolean contains (ItemStack item)
 
boolean contains (int materialId, int amount)
 
boolean contains (Material material, int amount) throws IllegalArgumentException
 
boolean contains (ItemStack item, int amount)
 
boolean containsAtLeast (ItemStack item, int amount)
 
HashMap< Integer,?extends ItemStackall (int materialId)
 
HashMap< Integer,?extends ItemStackall (Material material) throws IllegalArgumentException
 
HashMap< Integer,?extends ItemStackall (ItemStack item)
 
int first (int materialId)
 
int first (Material material) throws IllegalArgumentException
 
int first (ItemStack item)
 
int firstEmpty ()
 
void remove (int materialId)
 
void remove (Material material) throws IllegalArgumentException
 
void remove (ItemStack item)
 
void clear (int index)
 
void clear ()
 
List< HumanEntitygetViewers ()
 
String getTitle ()
 
InventoryType getType ()
 
ListIterator< ItemStackiterator ()
 
ListIterator< ItemStackiterator (int index)
 

Detailed Description

Interface to the inventory of a Player, including the four armor slots.

Definition at line 8 of file PlayerInventory.java.

Member Function Documentation

int org.bukkit.inventory.PlayerInventory.clear ( int  id,
int  data 
)

Clears all matching items from the inventory. Setting either value to -1 will skip it's check, while setting both to -1 will clear all items in your inventory unconditionally.

Parameters
idthe id of the item you want to clear from the inventory
datathe data of the item you want to clear from the inventory
Returns
The number of items cleared
Deprecated:
Magic value
ItemStack [] org.bukkit.inventory.PlayerInventory.getArmorContents ( )

Get all ItemStacks from the armor slots

Returns
All the ItemStacks from the armor slots
ItemStack org.bukkit.inventory.PlayerInventory.getBoots ( )

Return the ItemStack from the boots slot

Returns
The ItemStack in the boots slot
ItemStack org.bukkit.inventory.PlayerInventory.getChestplate ( )

Return the ItemStack from the chestplate slot

Returns
The ItemStack in the chestplate slot
int org.bukkit.inventory.PlayerInventory.getHeldItemSlot ( )

Get the slot number of the currently held item

Returns
Held item slot number
ItemStack org.bukkit.inventory.PlayerInventory.getHelmet ( )

Return the ItemStack from the helmet slot

Returns
The ItemStack in the helmet slot
HumanEntity org.bukkit.inventory.PlayerInventory.getHolder ( )

Gets the block or entity belonging to the open inventory

Returns
The holder of the inventory; null if it has no holder.

Implements org.bukkit.inventory.Inventory.

ItemStack org.bukkit.inventory.PlayerInventory.getItemInHand ( )

Returns the ItemStack currently hold

Returns
The currently held ItemStack
ItemStack org.bukkit.inventory.PlayerInventory.getLeggings ( )

Return the ItemStack from the leg slot

Returns
The ItemStack in the leg slot
void org.bukkit.inventory.PlayerInventory.setArmorContents ( ItemStack[]  items)

Put the given ItemStacks into the armor slots

Parameters
itemsThe ItemStacks to use as armour
void org.bukkit.inventory.PlayerInventory.setBoots ( ItemStack  boots)

Put the given ItemStack into the boots slot. This does not check if the ItemStack is a boots

Parameters
bootsThe ItemStack to use as boots
void org.bukkit.inventory.PlayerInventory.setChestplate ( ItemStack  chestplate)

Put the given ItemStack into the chestplate slot. This does not check if the ItemStack is a chestplate

Parameters
chestplateThe ItemStack to use as chestplate
void org.bukkit.inventory.PlayerInventory.setHeldItemSlot ( int  slot)

Set the slot number of the currently held item.

This validates whether the slot is between 0 and 8 inclusive.

Parameters
slotThe new slot number
Exceptions
IllegalArgumentExceptionThrown if slot is not between 0 and 8 inclusive
void org.bukkit.inventory.PlayerInventory.setHelmet ( ItemStack  helmet)

Put the given ItemStack into the helmet slot. This does not check if the ItemStack is a helmet

Parameters
helmetThe ItemStack to use as helmet
void org.bukkit.inventory.PlayerInventory.setItemInHand ( ItemStack  stack)

Sets the item in hand

Parameters
stackStack to set
void org.bukkit.inventory.PlayerInventory.setLeggings ( ItemStack  leggings)

Put the given ItemStack into the leg slot. This does not check if the ItemStack is a pair of leggings

Parameters
leggingsThe ItemStack to use as leggings

The documentation for this interface was generated from the following file: