How To Use The Item Command Wiki Guide

This Minecraft tutorial explains how to use the /item command with screenshots and step-by-step instructions.

You can use the /item command to instanty replace one item with another item. You can replace armor items worn, weapons held in your hands, items stored in chests and items in your inventory/hotbar. This is a great way to quickly put armor on a player during a Minecraft battle or change out a worn out weapon.

TIP: Starting in Minecraft Java Edition (PC/Mac) 1.17, the /item command replaces the /replaceitem command in Java Edition only!

Let’s explore how to use this cheat (game command).

How to Use the Item Command - Wiki Guide 1

Requirements

To run game commands in Minecraft, you have to turn cheats on in your world.

Item Command

Item Command in Minecraft Java Edition (PC/Mac)

In Minecraft Java Edition (PC/Mac) , the /item command has different syntaxes depending on what you would like to do.

To replace the item in a specified slot of a block with another item:

/item replace block <pos> <slot> with <item> [count]

To replace the item in a specified slot of a block from the slot of another block:

/item replace block <pos> <slot> from block <sourcePos> <sourceSlot> [modifier]

To replace the item in a specified slot of a block from the slot of another entity:

/item replace block <pos> <slot> from entity <sourceTarget> <sourceSlot> [modifier]

To replace the item in a specified slot of an entity with another item:

/item replace entity <target> <slot> with <item> [count]

To replace the item in a specified slot of an entity from the slot of another block:

/item replace entity <target> <slot> from block <sourcePos> <sourceTarget> <sourceSlot> [modifier]

To replace the item in a specified slot of an entity from the slot of another entity:

/item replace entity <target> <slot> from entity <sourceTarget> <sourceSlot> [modifier]

To modify the item in a specified slot of an entity:

/item modify entity <target> <slot> <modifier>

To modify the item in the specified slot of a block:

/item modify block <pos> <slot> <modifier>

Definitions

  • pos is the x y z coordinate of the block to replace.
  • sourcePos is the x y z coordinate of the block you wish to copy an item from.
  • target is the name of the player (or a target selector) that you wish to replace an item for.
  • sourceTarget is the name of the player (or a target selector) that you wish to copy an item from.
  • slot and sourceSlot are slot types. The slot is the destination slot and the sourceSlot is the slot to copy an item from. You can use the following:
    slot Description
    armor.chest Replace the chest armor item on a player, mob or armor stand
    armor.feet Replace the feet armor item on a player, mob or armor stand
    armor.head Replace the head armor item on a player, mob or armor stand
    armor.legs Replace the leg armor item on a player, mob or armor stand
    container.number Replace an item in a chest
    (number between 0 and 53 to indicate the slot position in the container)
    enderchest.number Replace an item in an ender chest
    (number between 0 and 26 to indicate the slot position in the ender chest)
    horse.number Replace an item in the chest of a mule, donkey or llama
    (number between 0 and 14 to indicate the slot position in the chest)
    horse.armor Replace the armor on a horse
    horse.chest Replace the chest on a horse, mule, donkey, or llama
    horse.saddle Replace the saddle on a horse, mule or donkey
    hotbar.number Replace a hotbar item
    (number between 0 and 8 to indicate the slot position in the hotbar)
    inventory.number Replace an inventory item
    (number between 0 and 26 to indicate the inventory position)
    villager.number Replace an item for a villager
    (number between 0 and 7)
    weapon Replace the weapon of the player or mob
    weapon.mainhand Replace the weapon held in the main hand of the player or mob
    weapon.offhand Replace the weapon held in the offhand of the player or mob
  • item is the name of the replacement item.
  • count is optional. It is the amount of the replacement item. If you don’t specify an amount, it will default to 1.
  • modifier is the name of an item modifier which is a data pack file. For example: my_namespace:upgrade_sword.

Examples

Example in Java Edition (PC/Mac)

To replace the head armor item with a netherite helmet for the player called 9Minecraft:

/item replace entity 9Minecraft armor.head with diamond_helmet

To put a saddle on all donkeys:

/item replace entity @e[type=donkey] horse.saddle with saddle

To replace the weapon in the main hand of all drowned with a trident:

/item replace entity @e[type=drowned] weapon.mainhand with trident

To put a netherite_pickaxe in the first slot of a chest (the chest is directly below you):

/item replace block ~ ~-1 ~ container.0 with netherite_pickaxe

How to Enter the Command

1. Open the Chat Window

The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:

  • For Java Edition (PC/Mac), press the T key to open the chat window.

2. Type the Command

In this example, we are going to equip a diamond helmet on the player called 9Minecraft with the following command:

/item replace entity 9Minecraft armor.head with diamond_helmet

Type the command in the chat window and press the Enter key to run the command.

How to Use the Item Command - Wiki Guide 2

Once the cheat has been entered, the item will be replaced.

How to Use the Item Command - Wiki Guide 3

Once you have entered the command, you will see the message “Replaced a slot on 9Minecraft with [Diamond Helmet]” appear in the lower left corner of the game window. This indicates that that slot that has been replaced with a diamond helmet.

How to Use the Item Command - Wiki Guide 4

As you can see, the diamond helmet is now being worn by 9Minecraft.

Congratulations, you have learned how to use the /item command in Minecraft.

Mods

1.19.4 Mods

1.19.3 Mods

1.19.2 Mods

1.18.2 Mods

1.16.5 Mods

1.15.2 Mods

1.12.2 Mods

1.8.9 Mods

1.7.10 Mods

1.18.1 Mods

1.17.1 Mods

1.14.4 Mods

1.13.2 Mods

1.11.2 Mods

1.10.2 Mods

1.9.4 Mods

Minecraft Modpacks

1.19.4 Modpacks

1.19.3 Modpacks

1.19.2 Modpacks

1.18.2 Modpacks

1.16.5 Modpacks

1.12.2 Modpacks

1.7.10 Modpacks

Forge Mods

Fabric Mods

Quilt Mods

Resource Packs

1.19.4 Resource Packs

1.19.3 Resource Packs

1.19.2 Resource Packs

1.18.2 Resource Packs

1.16.5 Resource Packs

1.15.2 Resource Packs

1.12.2 Resource Packs

1.8.9 Resource Packs

1.7.10 Resource Packs

1.18.1 Resource Packs

1.17.1 Resource Packs

1.14.4 Resource Packs

1.13.2 Resource Packs

1.11.2 Resource Packs

1.10.2 Resource Packs

1.9.4 Resource Packs

Shaders

1.19.4 Shaders

1.19.3 Shaders

1.19.2 Shaders

1.18.2 Shaders

1.17.1 Shaders

1.16.5 Shaders

Maps

1.19.4 Maps

1.19.3 Maps

1.19.2 Maps

1.18.2 Maps

1.16.5 Maps

1.15.2 Maps

1.12.2 Maps

1.8.9 Maps

1.7.10 Maps

1.18.1 Maps

1.17.1 Maps

1.14.4 Maps

1.13.2 Maps

1.11.2 Maps

1.10.2 Maps

1.9.4 Maps

Data Packs

1.19.4 Data Packs

1.19.3 Data Packs

1.19.2 Data Packs

1.18.2 Data Packs

1.16.5 Data Packs

1.15.2 Data Packs

1.18.1 Data Packs

1.17.1 Data Packs

1.14.4 Data Packs

1.13.2 Data Packs

MCPE/Bedrock

Mods & Addons

MCPE 1.19 Add-ons

MCPE 1.19 Mods

Texture Packs

MCPE 1.19 Texture Packs

MCPE 1.19 Resource Packs

Maps

MCPE 1.19 Maps

Clients

MCPE 1.19 Clients

Mod Menu Clients

Shaders

MCPE 1.19 Shaders

Render Dragon Shaders

Launchers

Skin Packs

Clients

1.19.4 Clients

1.19.3 Clients

1.19.2 Clients

1.18.2 Clients

1.16.5 Clients

1.12.2 Clients

1.8.9 Clients

Launchers

1.19.4 Launchers

1.19.3 Launchers

1.19.2 Launchers

1.18.2 Launchers

1.16.5 Launchers

1.12.2 Launchers

1.7.10 Launchers

Seeds

1.19.4 Seeds

1.19.3 Seeds

1.19.2 Seeds

1.18.2 Seeds

Skins

Plugins

Bukkit Plugins

Spigot Plugins

Paper Plugins

Tutorials

Installation Guide

Mobs Wiki Guide

Seeds Wiki Guide

Biomes Wiki Guide

Status Effects Wiki Guide

Enchantments Wiki Guide

Materials Wiki Guide

Command Blocks

Versions

Backlinks