On this page 6 sections
At a glance
Syntax and parameters — below
Replaces items in the inventory. Requires enabled cheats.
/replaceitem block <position> slot.container <slotId> <itemName> [amount] [data] [components]/replaceitem entity <target> <slotType> <slotId> <itemName> [amount] [data] [components]/replaceitem block <position> slot.container <slotId> <oldItemHandling> <itemName> [amount] [data] [components]/replaceitem entity <target> <slotType> <slotId> <oldItemHandling> <itemName> [amount] [data] [components]
In angular brackets — what must be written; in square brackets — optional. Words without brackets are written as-is.
| Parameter | What to write |
|---|---|
position | x, y, z coordinates (can use ~ and ^) |
slotId | integer |
itemName | item ID, for example diamond (total 3411) |
amount | integer |
data | integer |
components | JSON |
target | goal: username or selector @s, @p, @a, @r, @e |
slotType | one out of 14: slot.weapon.mainhand, slot.weapon.offhand, slot.armor.head, slot.armor.chest, slot.armor.legs, slot.armor.feet, slot.armor.body, slot.hotbar, and others |
oldItemHandling | one of: destroy, keep |
| What | Value |
|---|---|
| The command | /replaceitem |
| Who can | operator and command block |
| Cheats are required | yes |
| Variants of recording | 4 |
| In Java | such a command does not exist |
What does /replaceitem do in Bedrock?
Replaces items in the inventory.
Why doesn't /replaceitem work?
Commands require cheats: they are enabled in the world settings — after which achievements in this world are no longer awarded. This command can be executed by the world host or a command block.
All Bedrock commands Bedrock serversHow to enable cheats
Minecraft Bedrock 1.26.50.4 data: commands, parameters, and descriptions — from Mojang's official bedrock-samples repository.