Inventory paper/inventory_slot

Inventory Slot

Gets or sets the item in a specific inventory slot of a player.

Note: Slots 0–8 are the hotbar, 9–35 are the main storage, 36–39 are armour (boots→helmet), and 40 is the off-hand. Out-of-range slot indices are silently ignored.

Inputs

NameTypeOptionalDescription
exec exec Incoming execution.
player player The player whose inventory to access.
slot number Slot index (0–35 for main inventory; 36–39 armour; 40 off-hand).
item item_stack Item to place in the slot (SET only).

Outputs

NameTypeDescription
exec exec Continues after the operation.
item item_stack Item currently (or previously) in the slot.

Properties

KeyTypeDefaultDescription
op string "GET" GET or SET.
slot number 0 Slot Index

Examples

Clear a specific hotbar slot

Remove the item in hotbar slot 0.

  1. Set op=SET, slot=0
  2. Do not connect an item — the slot will be set to AIR.