Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerInventory.java
1 package org.bukkit.inventory;
2 
4 
5 /**
6  * Interface to the inventory of a Player, including the four armor slots.
7  */
8 public interface PlayerInventory extends Inventory {
9 
10  /**
11  * Get all ItemStacks from the armor slots
12  *
13  * @return All the ItemStacks from the armor slots
14  */
15  public ItemStack[] getArmorContents();
16 
17  /**
18  * Return the ItemStack from the helmet slot
19  *
20  * @return The ItemStack in the helmet slot
21  */
22  public ItemStack getHelmet();
23 
24  /**
25  * Return the ItemStack from the chestplate slot
26  *
27  * @return The ItemStack in the chestplate slot
28  */
29  public ItemStack getChestplate();
30 
31  /**
32  * Return the ItemStack from the leg slot
33  *
34  * @return The ItemStack in the leg slot
35  */
36  public ItemStack getLeggings();
37 
38  /**
39  * Return the ItemStack from the boots slot
40  *
41  * @return The ItemStack in the boots slot
42  */
43  public ItemStack getBoots();
44 
45  /**
46  * Put the given ItemStacks into the armor slots
47  *
48  * @param items The ItemStacks to use as armour
49  */
50  public void setArmorContents(ItemStack[] items);
51 
52  /**
53  * Put the given ItemStack into the helmet slot. This does not check if
54  * the ItemStack is a helmet
55  *
56  * @param helmet The ItemStack to use as helmet
57  */
58  public void setHelmet(ItemStack helmet);
59 
60  /**
61  * Put the given ItemStack into the chestplate slot. This does not check
62  * if the ItemStack is a chestplate
63  *
64  * @param chestplate The ItemStack to use as chestplate
65  */
66  public void setChestplate(ItemStack chestplate);
67 
68  /**
69  * Put the given ItemStack into the leg slot. This does not check if the
70  * ItemStack is a pair of leggings
71  *
72  * @param leggings The ItemStack to use as leggings
73  */
74  public void setLeggings(ItemStack leggings);
75 
76  /**
77  * Put the given ItemStack into the boots slot. This does not check if the
78  * ItemStack is a boots
79  *
80  * @param boots The ItemStack to use as boots
81  */
82  public void setBoots(ItemStack boots);
83 
84  /**
85  * Returns the ItemStack currently hold
86  *
87  * @return The currently held ItemStack
88  */
89  public ItemStack getItemInHand();
90 
91  /**
92  * Sets the item in hand
93  *
94  * @param stack Stack to set
95  */
96  public void setItemInHand(ItemStack stack);
97 
98  /**
99  * Get the slot number of the currently held item
100  *
101  * @return Held item slot number
102  */
103  public int getHeldItemSlot();
104 
105  /**
106  * Set the slot number of the currently held item.
107  * <p>
108  * This validates whether the slot is between 0 and 8 inclusive.
109  *
110  * @param slot The new slot number
111  * @throws IllegalArgumentException Thrown if slot is not between 0 and 8
112  * inclusive
113  */
114  public void setHeldItemSlot(int slot);
115 
116  /**
117  * Clears all matching items from the inventory. Setting either value to
118  * -1 will skip it's check, while setting both to -1 will clear all items
119  * in your inventory unconditionally.
120  *
121  * @param id the id of the item you want to clear from the inventory
122  * @param data the data of the item you want to clear from the inventory
123  * @return The number of items cleared
124  * @deprecated Magic value
125  */
126  @Deprecated
127  public int clear(int id, int data);
128 
129  public HumanEntity getHolder();
130 }
void setChestplate(ItemStack chestplate)
void setItemInHand(ItemStack stack)
void setLeggings(ItemStack leggings)
void setBoots(ItemStack boots)
void setHelmet(ItemStack helmet)
void setArmorContents(ItemStack[] items)