/

/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.

Commandready
50
/item replace entity @e weapon.mainhand with stone
Press C to copy
All entities
@e

Who or what the command applies to

Container slots are container.0 through container.n

optional

Overrides the dropdown when filled in

Item components1.20.5+none

A plain item needs nothing here. Add a component to give it a name, lore, enchantments or custom data.

optional

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.