/item
op 2Items/item replaced the old /replaceitem in 1.17. It writes an item into one exact slot — a helmet, an off hand, or slot 3 of a chest — which is how you equip mobs and stock containers without touching the rest of the inventory.
Who or what the command applies to
Container slots are container.0 through container.n
Overrides the dropdown when filled in
A plain item needs nothing here. Add a component to give it a name, lore, enchantments or custom data.
Examples
- Give a helmet
/item replace entity @p armor.head with diamond_helmet - Fill a chest slot
/item replace block ~ ~-1 ~ container.0 with diamond 64
Common questions about /item
›What happened to /replaceitem?
/replaceitem was removed in 1.17 and replaced by /item replace. The slot names are the same, so /replaceitem entity @p armor.head … becomes /item replace entity @p armor.head with ….
›How are container slots numbered?
container.0 is the first slot. A chest runs to container.26, a hopper to container.4. Player inventory slots use inventory.0 to inventory.26 with the hotbar as hotbar.0 to hotbar.8.