/replaceitem
Overwrites a specific inventory slot of a block (chest, hopper) or entity (player, mob) with a chosen item. The Bedrock counterpart to Java's /item replace — Java removed standalone /replaceitem in 1.17.
What is /replaceitem used for?
What /replaceitem is for
Overwrites a specific inventory slot of a block (chest, hopper) or entity (player, mob) with a chosen item — the Bedrock counterpart to Java's /item replace.
When to use /replaceitem
Force gear onto a player or mob, stock a container from a command, or set a mob's held item and armor on Bedrock.
Tips for /replaceitem
Slot names like slot.weapon.mainhand, slot.armor.head, and slot.container take an index (use 0 for single-slot equipment). Java users want /item replace instead.
Syntax
Parameters
- destination
- literal
- block <x y z> or entity <target>.
- slot
- slot type
- e.g. slot.weapon.mainhand, slot.armor.head, slot.container.
- slotId
- integer
- Index within the slot type (0 for single slots).
- item
- item ID
- Item to place.
Command builder
Fill in the options below to generate a ready-to-paste /replaceitem command.
block <x y z> or entity <target>.
e.g. slot.weapon.mainhand, slot.armor.head, slot.container.
Index within the slot type (0 for single slots).
Item to place.
Examples
Put a diamond sword in your main hand.
Fill the first slot of the container at your feet.
Permission level
/replaceitem requires Cheats (op level 2). In single-player you need the world's "Allow Cheats" toggle on. On a multiplayer server you need to be opped — see /op.