How to Use the ReplaceItem Command in Minecraft
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.
Let's explore how to use this cheat (game command).
Supported Platforms
The /replaceitem command is available in the following versions of Minecraft:
Platform | Supported (Version*) |
---|---|
Java Edition (PC/Mac) | Yes (1.8), but removed in (1.17) |
Pocket Edition (PE) | Yes (1.0.5) |
Xbox 360 | No |
Xbox One | Yes (1.2) |
PS3 | No |
PS4 | Yes (1.14.0) |
Wii U | No |
Nintendo Switch | Yes (1.5.0) |
Windows 10 Edition | Yes (1.0.5) |
Education Edition | Yes (1.0.18) |
* The version that it was added or removed, if applicable.
NOTE: Pocket Edition (PE), Xbox One, PS4, Nintendo Switch, and Windows 10 Edition are now called Bedrock Edition. We will continue to show them individually for version history.
Requirements
To run game commands in Minecraft, you have to turn cheats on in your world.
ReplaceItem Command
- Java
- PE
- Xbox
- PS
- Nintendo
- Win10
- Edu
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}.
ReplaceItem Command in Minecraft Pocket Edition (PE)
In Minecraft Pocket Edition (PE), the /replaceitem command has different syntaxes depending on what you would like to do.
To replace a block with another item:
/replaceitem block <position> slot.container <slotId> <itemName> [amount] [data] [components]
To replace an entity's item with another item:
/replaceitem entity <target> <slotType> <slotId> <itemName> [amount] [data] [components]
Definitions
- position is the x y z coordinate of the block to replace.
- target is the name of the player (or a target selector) that you wish to replace an item for.
-
slotType and slotId determine the type of slot and slot number that you wish to replace the item for. It can be one of the following:
slotType slotId Description slot.armor.chest 0 Replace the chest armor item on a player, mob or armor stand slot.armor.feet 0 Replace the feet armor item on a player, mob or armor stand slot.armor.head 0 Replace the head armor item on a player, mob or armor stand slot.armor.legs 0 Replace the leg armor item on a player, mob or armor stand slot.chest number Replace an item in a chest
(number between 0 and 53 to indicate the slot position in the container)slot.enderchest number Replace an item in an ender chest
(number between 0 and 26 to indicate the slot position in the ender chest)slot.hotbar number Replace a hotbar item
(number between 0 and 8 to indicate the slot position in the hotbar)slot.inventory number Replace an inventory item
(number between 0 and 26 to indicate the inventory position)slot.saddle 0 Replace the saddle on a horse, mule or donkey slot.weapon.mainhand 0 Replace the weapon held in the main hand of the player or mob slot.weapon.offhand 0 Replace the weapon held in the offhand of the player or mob - itemName is the name of the replacement item (See Minecraft item Names).
- 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).
- components is optional json.
ReplaceItem Command in Minecraft Xbox One Edition
In Minecraft Xbox One Edition, the /replaceitem command has different syntaxes depending on what you would like to do.
To replace a block with another item:
/replaceitem block <position> slot.container <slotId> <itemName> [amount] [data] [components]
To replace an entity's item with another item:
/replaceitem entity <target> <slotType> <slotId> <itemName> [amount] [data] [components]
Definitions
- position is the x y z coordinate of the block to replace.
- target is the name of the player (or a target selector) that you wish to replace an item for.
-
slotType and slotId determine the type of slot and slot number that you wish to replace the item for. It can be one of the following:
slotType slotId Description slot.armor.chest 0 Replace the chest armor item on a player, mob or armor stand slot.armor.feet 0 Replace the feet armor item on a player, mob or armor stand slot.armor.head 0 Replace the head armor item on a player, mob or armor stand slot.armor.legs 0 Replace the leg armor item on a player, mob or armor stand slot.chest number Replace an item in a chest
(number between 0 and 53 to indicate the slot position in the container)slot.enderchest number Replace an item in an ender chest
(number between 0 and 26 to indicate the slot position in the ender chest)slot.hotbar number Replace a hotbar item
(number between 0 and 8 to indicate the slot position in the hotbar)slot.inventory number Replace an inventory item
(number between 0 and 26 to indicate the inventory position)slot.saddle 0 Replace the saddle on a horse, mule or donkey slot.weapon.mainhand 0 Replace the weapon held in the main hand of the player or mob slot.weapon.offhand 0 Replace the weapon held in the offhand of the player or mob - itemName is the name of the replacement item (See Minecraft item Names).
- 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).
- components is optional json.
ReplaceItem Command in Minecraft PS4 Edition
In Minecraft PS4 Edition, the /replaceitem command has different syntaxes depending on what you would like to do.
To replace a block with another item:
/replaceitem block <position> slot.container <slotId> <itemName> [amount] [data] [components]
To replace an entity's item with another item:
/replaceitem entity <target> <slotType> <slotId> <itemName> [amount] [data] [components]
Definitions
- position is the x y z coordinate of the block to replace.
- target is the name of the player (or a target selector) that you wish to replace an item for.
-
slotType and slotId determine the type of slot and slot number that you wish to replace the item for. It can be one of the following:
slotType slotId Description slot.armor.chest 0 Replace the chest armor item on a player, mob or armor stand slot.armor.feet 0 Replace the feet armor item on a player, mob or armor stand slot.armor.head 0 Replace the head armor item on a player, mob or armor stand slot.armor.legs 0 Replace the leg armor item on a player, mob or armor stand slot.chest number Replace an item in a chest
(number between 0 and 53 to indicate the slot position in the container)slot.enderchest number Replace an item in an ender chest
(number between 0 and 26 to indicate the slot position in the ender chest)slot.hotbar number Replace a hotbar item
(number between 0 and 8 to indicate the slot position in the hotbar)slot.inventory number Replace an inventory item
(number between 0 and 26 to indicate the inventory position)slot.saddle 0 Replace the saddle on a horse, mule or donkey slot.weapon.mainhand 0 Replace the weapon held in the main hand of the player or mob slot.weapon.offhand 0 Replace the weapon held in the offhand of the player or mob - itemName is the name of the replacement item (See Minecraft item Names).
- 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).
- components is optional json.
ReplaceItem Command in Minecraft Nintendo Switch Edition
In Minecraft Nintendo Switch Edition, the /replaceitem command has different syntaxes depending on what you would like to do.
To replace a block with another item:
/replaceitem block <position> slot.container <slotId> <itemName> [amount] [data] [components]
To replace an entity's item with another item:
/replaceitem entity <target> <slotType> <slotId> <itemName> [amount] [data] [components]
Definitions
- position is the x y z coordinate of the block to replace.
- target is the name of the player (or a target selector) that you wish to replace an item for.
-
slotType and slotId determine the type of slot and slot number that you wish to replace the item for. It can be one of the following:
slotType slotId Description slot.armor.chest 0 Replace the chest armor item on a player, mob or armor stand slot.armor.feet 0 Replace the feet armor item on a player, mob or armor stand slot.armor.head 0 Replace the head armor item on a player, mob or armor stand slot.armor.legs 0 Replace the leg armor item on a player, mob or armor stand slot.chest number Replace an item in a chest
(number between 0 and 53 to indicate the slot position in the container)slot.enderchest number Replace an item in an ender chest
(number between 0 and 26 to indicate the slot position in the ender chest)slot.hotbar number Replace a hotbar item
(number between 0 and 8 to indicate the slot position in the hotbar)slot.inventory number Replace an inventory item
(number between 0 and 26 to indicate the inventory position)slot.saddle 0 Replace the saddle on a horse, mule or donkey slot.weapon.mainhand 0 Replace the weapon held in the main hand of the player or mob slot.weapon.offhand 0 Replace the weapon held in the offhand of the player or mob - itemName is the name of the replacement item (See Minecraft item Names).
- 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).
- components is optional json.
ReplaceItem Command in Minecraft Windows 10 Edition
In Minecraft Windows 10 Edition, the /replaceitem command has different syntaxes depending on what you would like to do.
To replace a block with another item:
/replaceitem block <position> slot.container <slotId> <itemName> [amount] [data] [components]
To replace an entity's item with another item:
/replaceitem entity <target> <slotType> <slotId> <itemName> [amount] [data] [components]
Definitions
- position is the x y z coordinate of the block to replace.
- target is the name of the player (or a target selector) that you wish to replace an item for.
-
slotType and slotId determine the type of slot and slot number that you wish to replace the item for. It can be one of the following:
slotType slotId Description slot.armor.chest 0 Replace the chest armor item on a player, mob or armor stand slot.armor.feet 0 Replace the feet armor item on a player, mob or armor stand slot.armor.head 0 Replace the head armor item on a player, mob or armor stand slot.armor.legs 0 Replace the leg armor item on a player, mob or armor stand slot.chest number Replace an item in a chest
(number between 0 and 53 to indicate the slot position in the container)slot.enderchest number Replace an item in an ender chest
(number between 0 and 26 to indicate the slot position in the ender chest)slot.hotbar number Replace a hotbar item
(number between 0 and 8 to indicate the slot position in the hotbar)slot.inventory number Replace an inventory item
(number between 0 and 26 to indicate the inventory position)slot.saddle 0 Replace the saddle on a horse, mule or donkey slot.weapon.mainhand 0 Replace the weapon held in the main hand of the player or mob slot.weapon.offhand 0 Replace the weapon held in the offhand of the player or mob - itemName is the name of the replacement item (See Minecraft item Names).
- 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).
- components is optional json.
ReplaceItem Command in Minecraft Education Edition
In Minecraft Education Edition, the /replaceitem command has different syntaxes depending on what you would like to do.
To replace a block with another item:
/replaceitem block <position> slot.container <slotId> <itemName> [amount] [data] [components]
To replace an entity's item with another item:
/replaceitem entity <target> <slotType> <slotId> <itemName> [amount] [data] [components]
Definitions
- position is the x y z coordinate of the block to replace.
- target is the name of the player (or a target selector) that you wish to replace an item for.
-
slotType and slotId determine the type of slot and slot number that you wish to replace the item for. It can be one of the following:
slotType slotId Description slot.armor.chest 0 Replace the chest armor item on a player, mob or armor stand slot.armor.feet 0 Replace the feet armor item on a player, mob or armor stand slot.armor.head 0 Replace the head armor item on a player, mob or armor stand slot.armor.legs 0 Replace the leg armor item on a player, mob or armor stand slot.chest number Replace an item in a chest
(number between 0 and 53 to indicate the slot position in the container)slot.enderchest number Replace an item in an ender chest
(number between 0 and 26 to indicate the slot position in the ender chest)slot.hotbar number Replace a hotbar item
(number between 0 and 8 to indicate the slot position in the hotbar)slot.inventory number Replace an inventory item
(number between 0 and 26 to indicate the inventory position)slot.saddle 0 Replace the saddle on a horse, mule or donkey slot.weapon.mainhand 0 Replace the weapon held in the main hand of the player or mob slot.weapon.offhand 0 Replace the weapon held in the offhand of the player or mob - itemName is the name of the replacement item (See Minecraft item Names).
- 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).
- components is optional json.
Examples
- Java
- PE
- Xbox
- PS
- Nintendo
- Win10
- Edu
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 DigMinecraft:
/replaceitem entity DigMinecraft 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 DigMinecraft:
/replaceitem entity DigMinecraft 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
Example in Pocket Edition (PE)
To replace the chest armor item with a diamond chestplate for the player called DigMinecraft:
/replaceitem entity DigMinecraft slot.armor.chest 0 diamond_chestplate
To put a diamond sword in the third slot of a chest that is located at the coordinates (22, 64, 36):
/replaceitem block 22 64 36 slot.chest 2 diamond_sword
Example in Xbox One Edition
To replace the feet armor item with diamond boots for the player called DigMinecraft:
/replaceitem entity DigMinecraft slot.armor.feet 0 diamond_boots
To put a trident in the seventh slot of a chest that is located at the coordinates (4, 68, 123):
/replaceitem block 4 68 123 slot.chest 6 trident
Example in PS4 Edition
To replace the chest armor item with a golden chestplate for the player called DigMinecraft:
/replaceitem entity DigMinecraft slot.armor.chest 0 golden_chestplate
To put a honey bottle in the third slot of a chest that is located at the coordinates (19, 65, -10):
/replaceitem block 19 65 -10 slot.chest 2 honey_bottle
Example in Nintendo Switch Edition
To replace the head armor item with an iron helmet for the player called DigMinecraft:
/replaceitem entity DigMinecraft slot.head.chest 0 iron_helmet
To put an iron pickaxe in the first slot of a chest that is located at the coordinates (-12, 70, 5):
/replaceitem block -12 70 5 slot.chest 0 iron_pickaxe
Example in Windows 10 Edition
To replace the item in the third slot of the hotbar with a golden pickaxe for all players:
/replaceitem entity @a slot.hotbar 2 golden_pickaxe
To put an iron sword in the second slot of a chest that is located at the coordinates (8, 69, 22):
/replaceitem block 8 69 22 slot.chest 1 iron_sword
Example in Education Edition
To replace the item in the sixth slot of the hotbar with a golden pickaxe for all players:
/replaceitem entity @a slot.hotbar 5 diamond_sword
To put a diamond chestplate in the first slot of an enderchest that is located at the coordinates (208, 69, 41):
/replaceitem block 208 69 41 slot.enderchest 0 diamond_chestplate
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 DigMinecraft with the following command:
/replaceitem entity DigMinecraft 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 DigMinecraft.
Congratulations, you have learned how to use the /replaceitem command in Minecraft.
Advertisements