Item Component Builder
Item
About the /item generator
The /item command modifies items already in the world rather than creating them from nothing. It can replace what is in a specific inventory slot of a player, a mob or a block container, and it can copy an item from one place to another. It is the precise alternative to /give when you need to control exactly which slot is affected.
How to use this generator
Choose whether you are replacing a slot or modifying an existing item, identify the target (an entity or a block position), name the slot, and define the item. Slot names differ between entities and containers, which is the most common source of a failed command.
Things worth knowing
- Entity slots use names such as weapon.mainhand, armor.head and hotbar.0 through hotbar.8.
- Container slots are numbered from container.0 upwards, and the numbering depends on the block.
- Replacing a slot destroys whatever was there, with no way to recover it in survival.
- /item replaced /replaceitem in 1.17, so older tutorials use a command that no longer exists.
The generated command is produced entirely in your browser and nothing you enter is sent to EloTiers. Paste the result into the chat bar or a command block in your own world. If a command is rejected, check that the Minecraft version selected here matches the version you are actually running — the item and entity data format changed substantially in 1.20.5.
Worked examples
Put a sword in your hand
/item replace entity @s weapon.mainhand with minecraft:diamond_swordThe item replaces whatever you were holding. @s refers to the player running the command.
Fill the first slot of a chest
/item replace block ~ ~-1 ~ container.0 with minecraft:apple 8This targets the container block directly below you and writes eight apples into slot 0, the top-left slot.
Equip a helmet
/item replace entity @s armor.head with minecraft:iron_helmetArmor slots are named armor.head, armor.chest, armor.legs and armor.feet.
Frequently asked questions
What is the difference between /item and /give?
/give adds an item to the first free space of an inventory. /item replace writes to one exact slot and overwrites what is there, which is what you need for armour, off-hand items and container layouts.
Why does it say the slot does not exist?
Slot names depend on the target. A player has hotbar, inventory and equipment slots, a chest has container.0 to container.26, and a mob only has equipment slots. Using a name that the target does not have makes the command fail.
Does /item still work with the old /replaceitem syntax?
No. /replaceitem was removed in Minecraft 1.17 and replaced by /item replace. Tutorials that still show /replaceitem are out of date.