/replaceitem

Replaces items in inventories.

Operator (cheats on)Cheats must be onChecked on 1.26.66.1

Syntax

Exactly as the game prints it. <angle brackets> are required, [square brackets] are optional.

/replaceitem block <position: x y z> slot.container <slotId: int> <itemName: Item> [amount: int] [data: int] [components: json]
/replaceitem block <position: x y z> slot.container <slotId: int> <oldItemHandling: ReplaceMode> <itemName: Item> [amount: int] [data: int] [components: json]
/replaceitem entity <target: target> <slotType: EntityEquipmentSlot> <slotId: int> <itemName: Item> [amount: int] [data: int] [components: json]
/replaceitem entity <target: target> <slotType: EntityEquipmentSlot> <slotId: int> <oldItemHandling: ReplaceMode> <itemName: Item> [amount: int] [data: int] [components: json]

Accepted values

EntityEquipmentSlot

slot.weapon.mainhandslot.weapon.offhandslot.armor.headslot.armor.chestslot.armor.legsslot.armor.feetslot.armor.bodyslot.hotbarslot.inventoryslot.enderchestslot.saddleslot.armorslot.chestslot.equippable

ReplaceMode

destroykeep

More from 9Minecraft

Command reference © 2026 9Minecraft.net. Syntax read from Minecraft Bedrock Edition 1.26.66.1.