Minecraft Wiki

The Minecraft Wiki is no longer considered as official by Microsoft and therefore several changes are required to be made, including to the wiki's logo. Please read this announcement for more information.

READ MORE

Minecraft Wiki
Advertisement
give
Permission level
required

2‌[JE only]
1‌[BE only]

Restrictions

Cheat only‌[BE only]

Gives an item to one or more players.

Syntax[]

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

Arguments[]

JE<targets>: entity
BE: player: target: CommandSelector<Player>

Specifies the target(s) to give item(s) to.
Must be a player name, a target selector or a UUID[Java Edition only]. And the target selector must be of player type.

JE<item>: item_stack
BE: itemName: Item: CommandItem

Specifies the item to give.
In Java Edition, it must be in form of item_id{data_tags}(accepts item and block tags), in which data tags can be omitted when they are not needed. In Bedrock Edition, it must be an item id or a block id for which items exist.

JE<count>: integer
BE: amount: int: int

Specifies the number of items to give. If not specified, defaults to 1.
Must be a 32-bit integer number. In Java Edition, it must be between 1 and 2147483647 (inclusive). In Bedrock Edition, it must be between 1 and 32767 (inclusive).

BE: data: int: int

Specifies the item data value of the given item(s). Values that are invalid for the specified item id revert to 0. If not specified, defaults to 0.
Must be a 32-bit integer number. It must be between 0 and 32767 (inclusive).

BE: components: json: Json::Value

Specifies the item components of the given item(s). Like data tags but supports only minecraft:can_place_on, minecraft:can_destroy, minecraft:item_lock, and minecraft:keep_on_death functions (see #Examples).
Must be a JSON Object.

Result[]

CommandTriggerJava EditionBedrock Edition
anythe arguments are not specified correctly Unparseable Failed
<targets> or player: target fails to resolve to one or more online players Failed
<count> is larger than 100 stack worth items N/A
On successGives the specified item(s) to the target(s)

On success, summons the specified item(s) at the location(s) of the target(s). If <targets> or player: target 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.

Output[]

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail00N/A
On success11the number of targeted players
Bedrock EditionOn fail0N/AN/A
On successthe number of players who are given item(s)N/AN/A

Examples[]

  • 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[Java Edition only]
  • To give all players a potion that has the Night Vision effect:
  • To give a random player a Sharpness X diamond sword:
    • /give @r diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:10}]} 1[Java Edition only]
  • To give the player executing the command a block of diamond that can be placed on dirt and can break quartz blocks, even in adventure mode.
    • /give @s minecraft:diamond_block{CanPlaceOn:["minecraft:dirt"],CanDestroy:["minecraft:quartz_block"]} 1[Java Edition only]
    • /give @s diamond_block 1 0 {"minecraft:can_place_on":{"blocks":["dirt"]},"minecraft:can_destroy":{"blocks":["quartz_block"]}} [Bedrock Edition only]
  • 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[Java Edition only]
  • To give the nearest player a diamond sword that will not be dropped on death:
  • To give all players a stick that cannot be dropped or crafted with:
    • /give @a stick 1 0 {"item_lock": {"mode": "lock_in_inventory"}}[Bedrock Edition only]
  • To give a random player a wooden shovel that cannot be moved from its slot, dropped, or crafted with:
    • /give @r wooden_shovel 1 0 {"item_lock": {"mode": "lock_in_slot"}}[Bedrock Edition only]

History[]

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.4.212w38a/give now gives items directly to the player instead of dropping them from the player.
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 24 ender pearls or 5 iron swords).
1.1217w16b/give now uses the @s selector, for giving specifically yourself an item.
1.1721w10aIntroduced new amount limitation in /give, can only give 100 stack worth items once now.
Pocket Edition Alpha
v0.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[]

  • /summon – summon any entity at any location

References[]


Advertisement