setSlot(slot_number, itemstack) you can iterate through slot numbers and set them to items with names/amounts to figure out Bukkit slot. public interface PlayerInventory extends Inventory. Interface to the inventory of a Player, including the four armor slots and any extra slots. Get the current recipe formed on the crafting inventory, if any. ItemStack · getResult(). Check what item is in the result slot of this crafting inventory. It is known that in some implementations this method will also set the inputted argument amount to the number of that item not removed from slots. Looking at the image LeePMC posted above, take the number of where you want to put the item, and put it in the first argument of the. An ItemStack only counts if both the type and the amount of the stack match. It will try to remove 'as much as possible' from the types and amounts you give as arguments. Removes all existing contents and replaces it with the ItemStacks given in the array. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open. The returned HashMap contains what it couldn't remove, where the key is the index of the parameter, and the value is the ItemStack at that index of the varargs parameter. What defines an extra slot is up to the implementation, however it will not be contained within Inventory. Change for test to: A player's crafting inventory, with 4 CRAFTING slots and a RESULT slot. JavaPlugin; I still get an unhandled exception on the line that it checked to see if its air or not. Your name or email address: The item on the player's cursor, or null if they aren't holding one. Sets an extra property of this inventory if supported by that inventory, for example the state of a progress bar.