Equip items or add them to your 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:
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:
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:
Here are some examples:
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:
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:
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:
Previous lesson: Entity effects | Next lesson: Enchanting items