Inventory paper/inventory_held

Held Item

Gets or sets the item in the player's main hand.

Note: The item output reflects the state before any SET operation. To check the off-hand, use Inventory Slot with slot index 40.

Inputs

NameTypeOptionalDescription
exec exec Incoming execution.
player player The player.
item item_stack Item to place in the main hand (SET only).

Outputs

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

Properties

KeyTypeDefaultDescription
op string "GET" GET or SET.

Examples

Replace the held item on interact

Swap a player's held item for a different one.

  1. Player Interact Trigger → player → Held Item
  2. Create Item (GOLDEN_SWORD) → item → Held Item (SET)