Commands/give

From Minecraft Wiki
Jump to: navigation, search
give
Restrictions

Operator

First introduced

Alpha v1.0.15 (0.1.0)
PE Alpha 0.16.0 (PE Alpha 0.16.0 build 1)

Gives an item to one or more players.

Syntax[edit]

  • Java Edition
give <player> <item>[<NBT>] [<count>]
  • Bedrock Edition
give <player: target> <itemName: Item> [amount: int] [data: int] [components: json]

Arguments[edit]

player (BE: player: target)
Specifies the target to give item(s) to. Must be a player name or target selector.
item (BE: itemName: Item)
Specifies the item to give. Must be a valid item ID (for example, minecraft:iron_shovel), or block ID for which items exist. Numerical ids are unsupported.
count (BE: amount: int) (optional)
Specifies the number of items to give. Must be between 1 and 64 (inclusive), but can be 64 even when that's more than one stack. If not specified, defaults to 1.
Item-specific stacking restrictions are not ignored, for example: /give @p minecraft:iron_sword 5 gives the player 5 stacks of 1 sword each.
data: int (optional)‌[Bedrock Edition only]
Specifies the item data of the given item(s). Must be an integer between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas), but values that are invalid for the specified item id revert to 0. If not specified, defaults to 0.
components: json (optional)‌[Bedrock Edition only]
Like DataTags but supports only CanPlaceOn and CanDestroy functions (for example, /give @p iron_shovel 1 0 {"minecraft:can_destroy":{"blocks":["grass"]}})

Result[edit]

Fails if the arguments are not specified correctly, or if player fails to resolve to one or more online players.
On success, summons the specified item(s) at the location(s) of the target(s). If player resolves to multiple targets, each receives the specified number of items. If there is room in the player's inventory, or the player is in creative mode, the item entity summoned is "fake", with its PickupDelay tag set to 32767 and its Age tag set to 5999, which would normally make it impossible to pick up the item, and have it despawn within a tick. If the player's inventory is full and they are not in creative mode, the item entity's Owner tag is set to the target and its PickupDelay tag set to 0 so that it can be picked up only by that player until within 10 seconds of it despawning, at which time other players may pick it up.[1]

Examples[edit]

To give the nearest player a diamond sword with Lore that says "A legendary weapon":
/give @p minecraft:diamond_sword{display:{Lore:["\"A legendary weapon\""]}} 1
To give all players a potion that has the Night Vision effect:
/give @a potion{Potion:"minecraft:night_vision"} 1
To give a random player a Sharpness X diamond sword:
/give @r diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:10}]} 1
To give Steve a block of diamond that can be placed on dirt and can break quartz blocks even in adventure mode.
/give Steve minecraft:diamond_block{CanPlaceOn:["minecraft:dirt"],CanDestroy:["minecraft:quartz_block"]} 1
To give all players a level 2 Wither Potion with Knockback X:
/give @a potion{Enchantments:[{id:"minecraft:knockback",lvl:10}],CustomPotionEffects:[{Id:20,Amplifier:1}]} 1

History[edit]

Java Edition Alpha
v1.0.15(Alpha server 0.1.0) Added /give.
The /give command always gives exactly one of the specified item (by numeric ID) to the specified player.
?(at or prior to Alpha server 0.1.2_01) Added count argument to /give.
Java Edition
1.0.0Beta 1.9 Prerelease 4Added damage value argument to /give.
1.3.112w16a/give is now usable in singleplayer.
1.513w04a/give now accepts data value as the fourth argument.
1.7.213w36aAdded dataTag argument to /give.
1.814w32b/give can no longer make 'illegal' stacks (such as 70 diamonds[verify] or 5 iron swords).
Pocket Edition Alpha
0.16.0build 1Added /give.
The functionality is almost equivalent to the Java 1.10 usage, except there is no support for data tags and the player target is optional in /give.

See also[edit]

/summon – summon any entity at any location

References[edit]