Minecraft /item command
Java EditionSince Java 1.17 (20w46a)
Quick answer: Puts, modifies or copies items into specific inventory slots of blocks or entities. Syntax:
item <modify|replace> <block <pos>|entity <targets>> <slot> .../item is the surgical tool for inventories: replace puts an exact item into a slot (a chest slot, a player's hotbar slot, armor and offhand slots), while modify applies an item modifier like a loot table function to whatever is already there. Bedrock Edition does not have /item - its equivalent is /replaceitem.
Syntax
| Edition | Syntax |
|---|---|
| Java | item <modify|replace> <block <pos>|entity <targets>> <slot> ... |
| Bedrock | (Java Edition only - Bedrock uses /replaceitem) |
Targets / arguments: Block containers and entity inventory slots. Requires: Cheats enabled / operator level 2.
Examples
/item replace entity @s weapon.mainhand with minecraft:netherite_swordPut a netherite sword in your main hand
/item replace block 100 64 200 container.0 with minecraft:diamond 64Fill the first slot of a chest with a stack of diamonds
/item replace entity @s armor.head with minecraft:carved_pumpkinEquip a carved pumpkin without opening the inventory
Tips
- Slot names matter: container.0 to container.26 for chests, weapon.mainhand, armor.head, horse.saddle...
- Combine with item components (1.20.5+) to give renamed, enchanted or unbreakable gear.
- Use /item modify with item modifiers to enchant or rename items in place.