🎒
Advanced
/item
Replace or modify the item in a specific inventory or equipment slot.
At a glance
Syntax
Syntax
/item replace <target> <slot> with <item>commandtargetcoordsvaluerequiredoptional
See it
What it does
/
Command executed
Anatomy
Every part, explained
- 1
CommandRequired/item replaceSwaps the item in a slot. Also has 'modify'.
- 2
TargetRequired<target>Who or what gets the item, e.g. entity @s.
- 3
SlotRequired<slot>The slot to fill, e.g. weapon.mainhand.
- 4
ItemRequiredwith <item>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_swordPut a sword in your main hand.
/item replace entity @s armor.head with diamond_helmetEquip a diamond helmet.
/item replace entity @s hotbar.0 with golden_apple 16Fill 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 stickSay 'entity' or 'block' before the target.
✕
/item replace entity @s mainhand with stick✓
/item replace entity @s weapon.mainhand with stickHand slots are weapon.mainhand and weapon.offhand.
Keep going