Minecraft 1.9 Inventory Slot Id

Jul 29, 2015  I'm starting a custom map for 1.9 release and I'm looking for the inventory slot id for the player's left hand. I've already tried the obvious slot numbers (36, 104 & 200). Any help is helpful, please don't reply unless you understand this part of technical 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.

< Commands
Restrictions
First introduced

Java Edition 1.8 (14w26a)
PE 1.0.5 (PE alpha 1.0.5.0)

Minecraft 1.9 Inventory Slot Id Number

Replaces items in the inventories of blocks (chest, furnaces, etc.) or entities (players or mobs) with the given item(s).

Syntax
  • Java Edition
replaceitem block <x> <y> <z> <slot> <item> [amount]
replaceitem entity <selector> <slot> <item> [amount]
  • Bedrock Edition
replaceitem block <position: x y z> slot.container <slotId: int> <itemName: Item> [amount: int] [data: int] [components: json]
replaceitem entity <target: target> <slotType: EntityEquipmentSlot> <slotId: int> <itemName: Item> [amount: int] [data: int] [components: json]
Arguments
x y z (BE: position: x y z) (block mode only)
Specifies the position of the block to be modified. May use tilde notation to specify a position relative to the command's execution.
selector (BE: target: target) (entity mode only)
Specifies one or more entities to modify. Must be a player name or target selector.
slot (BE: slotType: EntityEquipmentSlot and slotId: int)
Specifies the inventory slot to be modified. Valid values depend on whether a block or an entity is being modified.
For blocks, must be container.slot_number (BE: slot.container <slotId: int>) where slot_number or slotId: int is replaced with a number specifying the slot.
  • Chests, dispensers, droppers, hoppers, and trapped chests are numbered 0 for the top-left slot and then increase first horizontally, then vertically (so, for example, a chest's top row slots are numbered 0 to 8 from left to right). Double chests and double trapped chests are treated as two single container blocks.
  • A brewing stand's bottom slots are numbered 0 to 2 from left to right, its top slot is 3 and the fuel slot is 4.
  • A furnace's slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.
Other blocks which hold items but don't have inventory GUIs (flower pots and jukeboxes) can only be changed with /data.
For entities, must be one of the following, where slot_number is replaced with a number specifying the slot:
SlotSlot NumbersRestrictions
armor.chestarmor stands, mobs, and players only (though not all mobs will show or make use of the items)
armor.feet
armor.head
armor.legs
weapon.mainhand
weapon.offhand
container.slot_number[Java Edition only]0–53players and minecarts only
enderchest.slot_number
(BE: slot.enderchest <slotId: int>)
0–26players only
hotbar.slot_number
(BE: slot.hotbar <slotId: int>)
0–8
inventory.slot_number
(BE: slot.inventory <slotId: int>)
0–26item frames (slot 0) and players only
horse.saddle
(BE: slot.saddle <slotId: int>)
horses, donkeys, and mules only; item must be a saddle
horse.chest[Java Edition only]donkeys, and mules only; item must be a chest
horse.armor
(BE: slot.armor)
horses and llamas only; item must be a type of horse armor (if a horse) or a carpet (if a llama)
horse.slot_number
(BE: slot.chest <slotId: int>)
0–14donkeys and mules with chests only
villager.slot_number[Java Edition only]0–7villagers only
item (BE: itemName: Item)
Specifies the item to be placed in the block or entity's inventory slot. Must be an item id, or a block id for which an item exists (for example, minecraft:golden_sword).
amount (BE: amount: int) (optional)
Specifies the number of items to be placed in the block or entity's inventory slot. Must be between 1 and 64 (inclusive), even for items with a smaller stack size.

Inventory Slot Ids Minecraft

data (BE: data: int) (optional)‌[Bedrock Edition only]
Specifies the item data for the item(s) to be placed in the block or entity's inventory slot. Must be an integer between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas), but values which are invalid for the specified item id will default to 0. If not specified, defaults to 0.
components: json (optional)‌[Bedrock Edition only]
Like DataTags but only supports CanPlaceOn and CanDestroy functions (for example, replaceitem entity @s slot.weapon.mainhand 0 iron_shovel 1 0 {'minecraft:can_destroy':{'blocks':['grass']}})
Result
Fails if the arguments are not specified correctly, if the specified block is not a container, if selector fails to resolve to one or more entities (named players must be online), or if none of the targeted entities have the specified slot (for example, zombies don't have horse.armor).
On success, replaces the items in the specified slot with the specified items (previous items in that slot are lost) wherever possible.

Minecraft Inventory Slot Id

Examples
To replace the items in the bottom-right slot of a single chest one block above with four spruce saplings:
replaceitem block ~ ~1 ~ container.26 minecraft:sapling 4 1
To replace the items in the rightmost hotbar slot of the nearest player with four spruce saplings:
replaceitem entity @p hotbar.8 minecraft:sapling 4 1

History[edit]

Java Edition
1.814w26aAdded /replaceitem.
1.1418w43a/replaceitem can now be used on item frames.
Pocket Edition
1.0.5alpha 1.0.5.0Added /replaceitem.
1.1.0alpha 1.1.0.0CanPlaceOn and CanDestroy functions are now supported for /replaceitem.

See also[edit]

/blockdata — can also replace items in a container
/entitydata — can also replace items in a mob's inventory, or modify the drop chances of armor and weapons
/give — give items to players without specifying specific inventory slots or overwriting other items
Retrieved from 'https://minecraft.gamepedia.com/index.php?title=Commands/replaceitem&oldid=1484471'
You can [[Project:Find or fix a stub|help expand it]] by ''[https://wow.gamepedia.com/index.php?title=InventorySlotId&action=edit editing it]''.'>

Inventory Slots Minecraft

Main Menu

You may obtain the IDs either by calling GetInventorySlotInfo, ContainerIDToInventoryID, or from the table below. Note that you should never use these values in AddOns, since they may change. Use GetInventorySlotInfo(invSlotName) to get the current mapping. This list is only meant to be used as a reference for reverse mapping while debugging, or possibly for use in macros. These can be used for commands such as UseInventoryItem and PickupInventoryItem.

Minecraft 1.9 Inventory Slot Id
Graphical Explanation

Regular inventory items

Minecraft 1.9 Inventory Slot Id Generator

The current IDs for Inventory Slots are (see FrameXMLConstants.lua):

Minecraft 1.13 Inventory Slot Ids

When bank frame is open

Minecraft 1.9 Inventory Slot Id Codes

Retrieved from 'https://wow.gamepedia.com/index.php?title=InventorySlotId&oldid=5500437'