Giving items

Equip items or add them to your inventory.


The inventory of a minecraft player.
Commands can be used to equip items or add items to the player's inventory.

Having the right items in Minecraft could mean the difference between life and death. Using command blocks to add items can make the battle a lot easier.

There are several commands to accomplish this:

Give

The give command puts an item or block into a player's inventory. It will place the item in the first available slot, starting with the hotbar.

Syntax: /give [target] [item name] [amount]

Here are some examples:

/give @a diamond_chestplate

/give @a[r=10] diamond_block 40


Replaceitem

To replace an entity's item with another item or into the equipped items, use the following command:

Syntax: /replaceitem entity [target] [slotType] [slotId] [itemName] [amount]

Slots for player, mob or armor stand are:

  • slot.armor.chest
  • slot.armor.feet
  • slot.armor.head
  • slot.armor.legs
  • slot.weapon.mainhand
  • slot.weapon.offhand
  • slot.hotbar (hotbar slots go from 0 to 8)
  • slot.inventory (inventory slots go from 0 to 26)

Here are some examples:

/replaceitem entity @a slot.armor.chest 0 diamond_chestplate 1

/replaceitem entity @s slot.hotbar 0 fireworks


Horses have different slot types. Slot types include slot.armor and slot.saddle, but horses must be tamed before giving them a saddle or armor.

Here are some examples:

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

/replaceitem entity @e[type=horse] slot.armor 1 horsearmordiamond 1


To replace an item or block in a container (such as a chest or dispenser):

Syntax: /replaceitem block X Y Z slot.container [slotId] [itemName] [amount] [data] [components]
(Note that the container slot numbers start at 0, not 1.)

Example:

/replaceitem block 12 72 -1 slot.container 0 iron_boots 1


List of common items

The complete list of items is very long in Minecraft. You can search for items by name by typing them in the console or searching online. Here are some of the more common items:

  • diamond_axe
  • diamond_boots
  • diamond_chestplate
  • diamond_helmet
  • diamond_hoe
  • diamond_leggings
  • diamond_pickaxe
  • diamond_shovel
  • diamond_sword
  • bow
  • crossbow
  • arrow
  • elytra
  • shield
  • horsearmordiamond
  • saddle
  • lead
  • torch
  • trident
  • turtle_helmet
  • armor_stand
  • chest
  • dispenser
  • fireball
  • fireworks
  • flint_and_steel
  • bucket
  • fishing_rod
  • golden_apple



Previous lesson: Entity effects   |   Next lesson: Enchanting items


Copyright 2020, Peacemaker Media Empire.   |