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:Redirect Template:Infobox command

Gives a specified amount of a certain Minecraft:item to one or more Minecraft: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). Template:IN, this also summons a "fake" item entity, with its Template:Cd tag set to Template:Cd and its Template:Cd tag set to Template:Cd, 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. Template:IN, the item's Template:Cd tag is set to the target and its Template:Cd tag is set to Template:Cd so that it can be picked up only by that player at any time. Template:IN, 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. Template:IN, when dropping the item entity, the item using progress of the player is discarded. Template:IN, the "Use doors and switches" option (in the "Player Permission" screen) disables the player to drop any item entity, even caused by the Template:Cd command.

Syntax

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

Arguments

Template:Argument

Specifies the target(s) to give item(s) to.
Template:Arg desc

Template:Argument

Specifies the item to give.
Template:Arg desc

Template:Argument

Specifies the number of items to give. If not specified, defaults to 1.
Template:Arg desc Template:IN, it should be between 1 and 32767 (inclusive).

Template:El: Template:Argument

Specifies the item Minecraft: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.
Template:Arg desc It should be between 0 and 32767 (inclusive).

Template:El: Template:Argument

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).
Template:Arg desc

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

Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table

Examples

  • To give the nearest player a pig Minecraft:spawn egg:
    • /give @p pig_spawn_egg
  • To give the nearest player a Minecraft:diamond sword with Lore that says "Example":
  • To give all players a potion that has the Minecraft:Night Vision effect:
  • To give a random player a Minecraft:Sharpness X diamond sword:
    • /give @r diamond_sword[enchantments={"minecraft:sharpness":10}] 1Template:Only
  • To give the player executing the command a Minecraft:block of diamond that can be placed on Minecraft:dirt and can break Minecraft: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 Minecraft: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 Minecraft: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 Minecraft: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

External links

Navigation

Template:Navbox commands

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