All commands
🎒
Advanced

/item

Replace or modify the item in a specific inventory or equipment slot.

Try in Simulator

At a glance

Syntax

Syntax
/item replace <target> <slot> with <item>
commandtargetcoordsvaluerequiredoptional

See it

What it does

/
Command executed

Anatomy

Every part, explained

  1. 1
    /item replaceCommandRequired

    Swaps the item in a slot. Also has 'modify'.

  2. 2
    <target>TargetRequired

    Who or what gets the item, e.g. entity @s.

  3. 3
    <slot>SlotRequired

    The slot to fill, e.g. weapon.mainhand.

  4. 4
    with <item>ItemRequired

    The item to place, e.g. diamond_sword.

Your turn

Try it yourself

Playground
7 tokens · press Enter to run

Copy & paste

Examples

/item replace entity @s weapon.mainhand with diamond_sword

Put a sword in your main hand.

/item replace entity @s armor.head with diamond_helmet

Equip a diamond helmet.

/item replace entity @s hotbar.0 with golden_apple 16

Fill the first hotbar slot with 16 golden apples.

Avoid these

Common mistakes

/item replace @s weapon.mainhand with stick
/item replace entity @s weapon.mainhand with stick

Say 'entity' or 'block' before the target.

/item replace entity @s mainhand with stick
/item replace entity @s weapon.mainhand with stick

Hand slots are weapon.mainhand and weapon.offhand.

Keep going

Related commands