Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/give

From SAS Gaming Wiki

Template:Hatnote Template:Infobox command

Gives a specified amount of a certain Minecraft:item to one or more players.

Usage

Gives the specified item(s) to the target(s). If <targets> or player: target resolves to multiple targets, each receives the specified number of items.

If there is enough room in the player's inventory, or the player is in creative mode, gives the specified item(s). in Template:Editions, this also summons a "fake" item entity, with its

  1. REDIRECT Template:Code

Template:Redr tag set to

  1. REDIRECT Template:Code

Template:Redr and its

  1. REDIRECT Template:Code

Template:Redr tag set to

  1. REDIRECT Template:Code

Template:Redr, which would make it impossible to be picked up, and have it despawn within one tick.

If there is not enough room in the player's inventory, and the player is not in creative mode, gives the specified item(s) until the inventory is full, and summons the rest items as a item entity dropped by the player. in Template:Editions, the item's

  1. REDIRECT Template:Code

Template:Redr tag is set to the target and its

  1. REDIRECT Template:Code

Template:Redr tag is set to

  1. REDIRECT Template:Code

Template:Redr so that it can be picked up only by that player at any time. in Template:Editions, the item entity is dropped by the player as normal, having a 10-tick pickup delay and being able to be picked up by any entity. in Template:Editions, when dropping the item entity, the item using progress of the player is discarded. in Template:Editions, the "Use doors and switches" option (in the "Player Permission" screen) disables the player to drop any item entity, even caused by the

  1. REDIRECT Template:Code

Template:Redr command.

Syntax

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

Arguments

Template:El<targets>: entity
Template:El: player: target: CommandSelector<Player>

Specifies the target(s) to give item(s) to.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|entity}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Template:El<item>: item_stack
Template:El: itemName: Item: enum

Specifies the item to give.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|item_stack}}{{#vardefine:be-arg|item_be}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Template:El<count>: integer
Template:El: amount: int: int

Specifies the number of items to give. If not specified, defaults to 1.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|integer}}{{#vardefine:be-arg|integer}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} in Template:Editions, it should be between 1 and 32767 (inclusive).
  1. REDIRECT Template:Edition

Template:Rcat: 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.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|integer}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} It should be between 0 and 32767 (inclusive).
  1. REDIRECT Template:Edition

Template:Rcat: components: json: Json::Value

Specifies the Minecraft: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).
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|component}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Template:Notelist

Output

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|0}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of targeted players}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|the number of players who are given item(s)}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

Examples

  • To give the nearest player a pig spawn egg:
    • /give @p pig_spawn_egg
  • To give the nearest player a diamond sword with Lore that says "Example":
  • 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={"minecraft:sharpness":10}] 1Template:Only
  • To give the player executing the command a block of diamond that can be placed on Minecraft:dirt and can break blocks of quartz, even in Adventure mode.
    • /give @s diamond_block[can_place_on={blocks:"dirt"},can_break={blocks:"quartz_block"}] 1Template:Only
    • /give @s diamond_block 1 0 {"minecraft:can_place_on":{"blocks":["dirt"]},"minecraft:can_destroy":{"blocks":["quartz_block"]}} Template:Only
  • To give all players a level 2 Wither Potion with Knockback X:
    • /give @a potion[enchantments={"minecraft:knockback":10},potion_contents={custom_effects:[{id:"minecraft:wither",amplifier:1,duration:3600}]}] 1Template:Only
  • To give the nearest player a diamond sword that is not dropped upon 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"}}Template: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"}}Template:Only
  • To give the nearest player a grass block that works like a Minecraft:pickaxe:
    • /give @p grass_block[max_stack_size=1,max_damage=100,damage=0,tool={default_mining_speed:2,damage_per_block:1,rules:[{blocks:"#mineable/pickaxe",speed:8,correct_for_drops:true}]}] 1Template:Only
  • To give a random player an item frame that is invisible:
    • /give @r minecraft:item_frame[minecraft:entity_data={id:item_frame,Invisible:1b}] 1Template:Only
  • To give the nearest player a spawn egg that looks like a wolf spawn egg but spawns a cat:
    • /give @p minecraft:wolf_spawn_egg[entity_data={id:"minecraft:cat"}] Template:Only
  • To give the nearest player 36 stacks of 64 totems each:
    • /give @s minecraft:totem_of_undying[max_stack_size=64] 2304 Template:Only

History

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

See also

  1. REDIRECT Template:Command

Template:Redr – summon any entity at any location

External links

Navigation

All editions
Removed
Template:El only
Debug
Removed
Template:Els only
Template:El only
Removed
Template:El only
Removed
Template:Els only
Removed
Joke
Related

de:Befehl/give es:Comandos/give fr:commandes/give ja:コマンド/give pt:Comandos/give ru:Команды консоли/give uk:Команди консолі/give zh:命令/give