Add ability to change player item in hand. Adds BUKKIT-3318

By: Patrick Seidel <psycowithespn1@aim.com>
This commit is contained in:
Bukkit/Spigot
2012-12-27 17:08:09 -05:00
parent d52aad59f3
commit 07bdbf973d
2 changed files with 21 additions and 1 deletions

View File

@@ -102,6 +102,16 @@ public interface PlayerInventory extends Inventory {
*/
public int getHeldItemSlot();
/**
* Set the slot number of the currently held item.
* <p>
* This validates whether the slot is between 0 and 8 inclusive.
*
* @param slot The new slot number
* @throws IllegalArgumentException Thrown if slot is not between 0 and 8 inclusive
*/
public void setHeldItemSlot(int slot);
/**
* 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.