setItem

public void setItem(int slot, ItemStack item)

Sets one item in this inventory view by its raw slot ID.

Note: If slot ID -999 is chosen, it may be expected that the item is dropped on the ground. This is not required behaviour, however.

Parameters

slot

The ID as returned by InventoryClickEvent.getRawSlot()

item

The new item to put in the slot, or null to clear it.