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

You can use the /replaceitem 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 Java Edition 1.17, the /replaceitem command was replaced by the /item command for Java Edition only!

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

Requirements

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

ReplaceItem Command

ReplaceItem Command in Minecraft Java Edition (PC/Mac)

In Minecraft Java Edition (PC/Mac) 1.13, 1.14, 1.15 and 1.16, the /replaceitem command has different syntaxes depending on what you would like to do.

To replace a block with another item:

/replaceitem block <pos> <slot> <item> [count]

To replace an entity’s item with another item:

/replaceitem entity <targets> <slot> <item> [count]

 

In Minecraft Java Edition (PC/Mac) 1.8, 1.9, 1.10, 1.11 and 1.12, the /replaceitem command has different syntaxes depending on what you would like to do.

To replace a block with another item:

/replaceitem block <x> <y> <z> <slot> <itemName> [amount] [data] [dataTag]

To replace an entity’s item with another item:

/replaceitem entity <target> <slot> <itemName> [amount] [data] [dataTag]

Definitions

  • pos or x y z is the x y z coordinate of the block to replace.
  • target or targets is the name of the player (or a target selector) that you wish to replace an item for.
  • slot is the type of slot and slot number that you wish to replace the item for. It can be one of the following (Note: the first column in the table shows the slot value in Java Edition 1.13 and the second column shows the slot value in Java Edition 1.8-1.12):
    slot (1.13-1.16) slot (1.8-1.12) Description
    armor.chest slot.armor.chest Replace the chest armor item on a player, mob or armor stand
    armor.feet slot.armor.feet Replace the feet armor item on a player, mob or armor stand
    armor.head slot.armor.head Replace the head armor item on a player, mob or armor stand
    armor.legs slot.armor.legs Replace the leg armor item on a player, mob or armor stand
    container.number slot.container.number Replace an item in a chest
    (number between 0 and 53 to indicate the slot position in the container)
    enderchest.number slot.enderchest.number Replace an item in an ender chest
    (number between 0 and 26 to indicate the slot position in the ender chest)
    horse.armor slot.horse.armor Replace the armor on a horse
    horse.chest slot.horse.chest Replace the chest on a horse, mule, donkey, or llama
    horse.saddle slot.horse.saddle Replace the saddle on a horse, mule or donkey
    horse.number slot.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)
    hotbar.number slot.hotbar.number Replace a hotbar item
    (number between 0 and 8 to indicate the slot position in the hotbar)
    inventory.number slot.inventory.number Replace an inventory item
    (number between 0 and 26 to indicate the inventory position)
    villager.number slot.villager.number Replace an item for a villager
    (number between 0 and 7)
    weapon.mainhand slot.weapon.mainhand Replace the weapon held in the main hand of the player or mob
    weapon.offhand slot.weapon.offhand Replace the weapon held in the offhand of the player or mob
  • item or itemName is the name of the replacement item (See Minecraft item Names).
  • count or amount is optional. It is the amount of the replacement item. If you don’t specify an amount, it will default to 1.
  • data is optional. It is the data value for the replacement item. It identifies the variation of the block if more than one type exists for that Item ID (See Minecraft Data Values).
  • dataTag is optional. It is the data tag that you want to set for the replacement item. It is a compound NBT tag such as {Potion:harming}.

Examples

Example in Java Edition (PC/Mac) 1.13, 1.14, 1.15 and 1.16

(NOTE: use the /item command instead for Java Edition 1.17 and higher)

To replace the head armor item with an iron helmet for the player called 9Minecraft:

/replaceitem entity 9Minecraft armor.head iron_helmet

To put a saddle on all donkeys:

/replaceitem entity @e[type=donkey] horse.saddle saddle

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

/replaceitem entity @e[type=drowned] weapon.mainhand trident

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

/replaceitem block ~ ~-1 ~ container.0 diamond_pickaxe

Example in Java Edition (PC/Mac) 1.11 and 1.12

To replace the chest armor item with a diamond chestplate for the player called 9Minecraft:

/replaceitem entity 9Minecraft slot.armor.chest diamond_chestplate

To put a saddle on all mules:

/replaceitem entity @e[type=mule] slot.horse.saddle saddle

To replace the weapon in the main hand of all zombies with a feather:

/replaceitem entity @e[type=zombie] slot.weapon.mainhand feather

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

/replaceitem block ~ ~-1 ~ slot.container.0 iron_boots

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.
  • For Pocket Edition (PE), tap on the chat button  at the top of the screen.
  • For Xbox One, press the D-Pad (right)  on the controller.
  • For PS4, press the D-Pad (right)  on the controller.
  • For Nintendo Switch, press the right arrow button  on the controller.
  • For Windows 10 Edition, press the T key to open the chat window.
  • For Education Edition, press the T key to open the chat window.

2. Type the Command

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

/replaceitem entity 9Minecraft slot.armor.chest diamond_chestplate

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

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

Once you have entered the command, you will see the message “Replaced slot slot.armor.chest with 1 x [Diamond Chestplate]” appear in the lower left corner of the game window. This indicates that that slot has been replaced with a diamond chestplate.

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

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

Click to rate this post!
[Total: 2 Average: 5]