Give
Minecraft command for getting vanilla or modded items.
The /give command allows for a player to get minecraft items, and allows for customization of items with the use of nbt. This command also
allows for obtaining items not commonly found in the creative inventory, like light blocks or command blocks.
The general command logic goes for the following /give <selector> <namespace:item_id><NBT> <amount> without the brackets <>.
Without specifying the count it will always default to giving 1 of that item.
How /give sends items
The /give command summons an item entity at the targets location as an entity. If the player's inventory is full and is in survival
then the items will drop, but if the player is in creative then it will immediately despawn.
If you are worried about the potential lag of /give then best practices are to use /loot commands.
Item NBT
Modern NBT (Named Binary Tag) or components uses JSON-styled formatting inside square brackets []. Then after the
brackets inside it is immediately followed by the tag name used by said item to apply data and functions to itself.
NBT offers tons of creativity to creating items, and allows for datapack and resourcepack functionality.
Item generators
It can be hard trying to remember all NBT tags and what they do, so the minecraft community offers lots of solutions to generating
the /give command!
GamerGeeks - great for more visual generation of items.
MCStacker - great for more technical generation of items.
Modded items
The /give command also allows for giving modded items, as long as you have the namespace and item id of the modded item.
To see the namespace and item id of any item press F3 + H to show advanced tooltips, then hover over the item and it will show the namespace and item id at the
very bottom.
Examples
Giving yourself 1 diamond:
/give @s diamond
Giving player Bob 4 acacia logs:
/give Bob minecraft:acacia_log 4
Giving yourself a diamond sword with custom name and lore:
/give @s diamond_sword[custom_name=[{"text":"Custom name","bold":true,"italic":false,"color":"light_purple"}],lore=[[{"text":"YUP","italic":false,"color":"gray"}]]]
Use cases
Mostly used for getting items with custom NBT data.
Useful for getting items that aren't in the creative inventory.
Useful for version testing and debugging items in datapacks.
Creating new items for adventure maps and servers.
Reference
Information:
https://minecraft.wiki/w/Commands/give
https://minecraft.wiki/w/Item_components
https://docs.fabricmc.net/develop/items/custom-data-components
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/commandsreference/examples/commands/give?view=minecraft-bedrock-stable
https://minecraft.fandom.com/wiki/Commands/give#:~:text=8%20References-,Syntax,only%5D%20be%20of%20player%20type