Minecraft:Commands/give: Difference between revisions
More actions
imported>Nixinova |
Fix template calls: add MC/ prefix |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{Redirect|Give|the option in the teacher menu|Teacher Menu#Give}} | {{MC/Redirect|Give|the option in the teacher menu|Teacher Menu#Give}} | ||
{{Infobox command | {{Infobox command | ||
| name = give | | name = give | ||
| Line 5: | Line 5: | ||
* 2 {{only|java|short=1}} | * 2 {{only|java|short=1}} | ||
* 1 {{only|bedrock|short=1}} | * 1 {{only|bedrock|short=1}} | ||
| others = | | others = Cheat only{{only|bedrock|short=1}} | ||
}} | }} | ||
Gives a specified amount of a certain [[Minecraft:item]] to one or more | Gives a specified amount of a certain [[Minecraft:item]] to one or more players. | ||
== Usage == | == Usage == | ||
Gives the specified item(s) to the target(s). If <code><targets></code> or <code>player: target</code> resolves to multiple targets, each receives the specified number of items. | Gives the specified item(s) to the target(s). If <code><targets></code> or <code>player: target</code> 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). {{ | If there is enough room in the player's inventory, or the player is in creative mode, gives the specified item(s). {{MC/In|java}}, this also summons a "fake" [[Minecraft:Item (entity)|item entity]], with its {{MC/Cd|PickupDelay}} tag set to {{MC/Cd|32767}} and its {{MC/Cd|Age}} tag set to {{MC/Cd|5999}}, 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 [[Minecraft:Item (entity)|item entity]] dropped by the player. {{ | 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 [[Minecraft:Item (entity)|item entity]] dropped by the player. {{MC/In|java}}, the item's {{MC/Cd|Owner}} tag is set to the target and its {{MC/Cd|PickupDelay}} tag is set to {{MC/Cd|0}} so that it can be picked up only by that player at any time. {{MC/In|bedrock}}, 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. {{MC/In|bedrock}}, when dropping the item entity, the item using progress of the player is discarded. {{MC/In|bedrock}}, the "Use doors and switches" option (in the "Player Permission" screen) disables the player to drop any item entity, even caused by the {{MC/Cd|/give}} command. | ||
== Syntax == | == Syntax == | ||
| Line 25: | Line 25: | ||
== Arguments == | == Arguments == | ||
{{ | {{MC/Argument|targets|entity|player: target|CommandSelector<Player>}} | ||
: Specifies the target(s) to give item(s) to. | : Specifies the target(s) to give item(s) to. | ||
: {{ | : {{MC/Arg desc|je=entity|amount=multiple|type=players|be=player}} | ||
{{ | {{MC/Argument|item|item_stack|itemName: Item|enum}} | ||
: Specifies the item to give. | : Specifies the item to give. | ||
: {{ | : {{MC/Arg desc|je=item_stack|be=CommandItem}} | ||
{{ | {{MC/Argument|count|integer|amount: int|int}} | ||
:Specifies the number of items to give. If not specified, defaults to <code>1</code>. | :Specifies the number of items to give. If not specified, defaults to <code>1</code>. | ||
: {{ | : {{MC/Arg desc|je=integer|be=int|min=1}} {{MC/In|bedrock}}, it should be between 1 and 32767 (inclusive). | ||
{{ | {{MC/El|be|short=1}}: {{MC/Argument|be=1|data: int|int}} | ||
: Specifies the item | : 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. | ||
: {{ | : {{MC/Arg desc|be=int}} It should be between 0 and 32767 (inclusive).<!-- do not put 16-bit integer as it redundant --> | ||
{{ | {{MC/El|be|short=1}}: {{MC/Argument|be=1|components: json|Json::Value}} | ||
: Specifies the [[Minecraft:item components]] of the given item(s). Like data tags but supports only <code>minecraft:can_place_on</code>, <code>minecraft:can_destroy</code>, <code>minecraft:item_lock</code>, and <code>minecraft:keep_on_death</code> functions (see [[#Examples]]). | : Specifies the [[Minecraft:item components]] of the given item(s). Like data tags but supports only <code>minecraft:can_place_on</code>, <code>minecraft:can_destroy</code>, <code>minecraft:item_lock</code>, and <code>minecraft:keep_on_death</code> functions (see [[#Examples]]). | ||
: {{ | : {{MC/Arg desc|be=Json::Value}} | ||
== Result == | == Result == | ||
{{Result table}} | {{Result table}} | ||
{{Result table|The command is incomplete, or any argument is not specified correctly.|unparseable|unparseable}} | {{Result table|The command is incomplete, or any argument is not specified correctly.|unparseable|unparseable}} | ||
{{Result table|<code>player: target</code> is a target selector that is not of | {{Result table|<code>player: target</code> is a target selector that is not of player type.|N/A|fail}} | ||
{{Result table|<code>amount: int</code> is not between 1 and 32767.|succeed}} | {{Result table|<code>amount: int</code> is not between 1 and 32767.|succeed}} | ||
{{Result table|<code>data: int</code> is not between 0 and 32767.}} | {{Result table|<code>data: int</code> is not between 0 and 32767.}} | ||
| Line 61: | Line 61: | ||
== Output == | == Output == | ||
{{Output table}} | {{MC/Output table}} | ||
{{Output table|edition=je|On fail|0|0}} | {{MC/Output table|edition=je|On fail|0|0}} | ||
{{Output table|On success|1|1|the number of targeted players}} | {{MC/Output table|On success|1|1|the number of targeted players}} | ||
{{Output table|edition=be|On fail|0}} | {{MC/Output table|edition=be|On fail|0}} | ||
{{Output table|On success|the number of players who are given item(s)}} | {{MC/Output table|On success|the number of players who are given item(s)}} | ||
{{Output table}} | {{MC/Output table}} | ||
== Examples == | == Examples == | ||
* To give the nearest player a pig | * To give the nearest player a pig spawn egg: | ||
** <code>/give @p pig_spawn_egg</code> | ** <code>/give @p pig_spawn_egg</code> | ||
* To give the nearest player a | * To give the nearest player a diamond sword with Lore that says "Example": | ||
** <code>/give @p diamond_sword[lore=["Example"]] 1</code>{{only|java}} | ** <code>/give @p diamond_sword[lore=["Example"]] 1</code>{{only|java}} | ||
* To give all players a potion that has the | * To give all players a potion that has the Night Vision effect: | ||
** <code>/give @a potion[potion_contents={potion:"minecraft:night_vision"}] 1</code>{{only|java}} | ** <code>/give @a potion[potion_contents={potion:"minecraft:night_vision"}] 1</code>{{only|java}} | ||
** <code>/give @a potion 1 5</code>{{only|bedrock}} | ** <code>/give @a potion 1 5</code>{{only|bedrock}} | ||
* To give a random player a | * To give a random player a Sharpness X diamond sword: | ||
** <code>/give @r diamond_sword[enchantments={"minecraft:sharpness":10}] 1</code>{{only|java}} | ** <code>/give @r diamond_sword[enchantments={"minecraft:sharpness":10}] 1</code>{{only|java}} | ||
* To give the player executing the command a | * 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. | ||
** <code>/give @s diamond_block[can_place_on={blocks:"dirt"},can_break={blocks:"quartz_block"}] 1</code>{{only|java}} | ** <code>/give @s diamond_block[can_place_on={blocks:"dirt"},can_break={blocks:"quartz_block"}] 1</code>{{only|java}} | ||
** <code><nowiki>/give @s diamond_block 1 0 {"minecraft:can_place_on":{"blocks":["dirt"]},"minecraft:can_destroy":{"blocks":["quartz_block"]}} </nowiki></code>{{only|bedrock}} | ** <code><nowiki>/give @s diamond_block 1 0 {"minecraft:can_place_on":{"blocks":["dirt"]},"minecraft:can_destroy":{"blocks":["quartz_block"]}} </nowiki></code>{{only|bedrock}} | ||
* To give all players a level 2 Wither Potion with | * To give all players a level 2 Wither Potion with Knockback X: | ||
** <code>/give @a potion[enchantments={"minecraft:knockback":10},potion_contents={custom_effects:[{id:"minecraft:wither",amplifier:1,duration:3600}]}] 1</code>{{only|java}} | ** <code>/give @a potion[enchantments={"minecraft:knockback":10},potion_contents={custom_effects:[{id:"minecraft:wither",amplifier:1,duration:3600}]}] 1</code>{{only|java}} | ||
* To give the nearest player a diamond sword that is not dropped upon death: | * To give the nearest player a diamond sword that is not dropped upon death: | ||
| Line 87: | Line 87: | ||
* To give all players a stick that cannot be dropped or crafted with: | * To give all players a stick that cannot be dropped or crafted with: | ||
** <code><nowiki>/give @a stick 1 0 {"item_lock":{"mode":"lock_in_inventory"}}</nowiki></code>{{only|bedrock}} | ** <code><nowiki>/give @a stick 1 0 {"item_lock":{"mode":"lock_in_inventory"}}</nowiki></code>{{only|bedrock}} | ||
* To give a random player a | * To give a random player a wooden shovel that cannot be moved from its slot, dropped, or crafted with: | ||
** <code><nowiki>/give @r wooden_shovel 1 0 {"item_lock":{"mode":"lock_in_slot"}}</nowiki></code>{{only|bedrock}} | ** <code><nowiki>/give @r wooden_shovel 1 0 {"item_lock":{"mode":"lock_in_slot"}}</nowiki></code>{{only|bedrock}} | ||
* To give the nearest player a grass block that works like a [[Minecraft:pickaxe]]: | * To give the nearest player a grass block that works like a [[Minecraft:pickaxe]]: | ||
** <code><nowiki>/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}]}] 1</nowiki></code>{{only|java}} | ** <code><nowiki>/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}]}] 1</nowiki></code>{{only|java}} | ||
* To give a random player an | * To give a random player an item frame that is invisible: | ||
** <code>/give @r minecraft:item_frame[minecraft:entity_data={id:item_frame,Invisible:1b}] 1</code>{{only|java}} | ** <code>/give @r minecraft:item_frame[minecraft:entity_data={id:item_frame,Invisible:1b}] 1</code>{{only|java}} | ||
*To give the nearest player a spawn egg that looks like a wolf spawn egg but spawns a cat: | *To give the nearest player a spawn egg that looks like a wolf spawn egg but spawns a cat: | ||
| Line 101: | Line 101: | ||
=== ''Java Edition'' === | === ''Java Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|java alpha}} | |{{MC/HistoryLine|java alpha}} | ||
|{{HistoryLine||v1.0.15|dev=server 0.1.0|Added {{ | |{{HistoryLine||v1.0.15|dev=server 0.1.0|Added {{MC/Cmd|give|link=none}}. | ||
|The {{ | |The {{MC/Cmd|give|link=none}} [[Minecraft:commands|command]] always gives exactly one of the specified [[Minecraft:item]] (by numeric ID) to the specified player.}} | ||
|{{HistoryLine||v1.0.16_01|Added count argument to {{ | |{{HistoryLine||v1.0.16_01|Added count argument to {{MC/Cmd|give|link=none}}.{{check version|not on page}}}} | ||
|{{HistoryLine|java}} | |{{MC/HistoryLine|java}} | ||
|{{HistoryLine||1.0.0|dev=Beta 1.9 Prerelease 4|Added {{ | |{{HistoryLine||1.0.0|dev=Beta 1.9 Prerelease 4|Added {{MC/Cd|damage}} value argument to {{MC/Cmd|give|link=none}}.}} | ||
|{{HistoryLine||1.3.1|dev=12w16a|{{ | |{{HistoryLine||1.3.1|dev=12w16a|{{MC/Cmd|give|link=none}} is now usable in singleplayer.}} | ||
|{{HistoryLine||1.4.2|dev=12w38a|{{ | |{{HistoryLine||1.4.2|dev=12w38a|{{MC/Cmd|give|link=none}} now gives items directly to the player instead of dropping them from the player.}} | ||
|{{HistoryLine||1.5|dev=13w04a|{{ | |{{HistoryLine||1.5|dev=13w04a|{{MC/Cmd|give|link=none}} now accepts data value as the fourth argument.}} | ||
|{{HistoryLine||1.7.2|dev=13w36a|Added {{ | |{{HistoryLine||1.7.2|dev=13w36a|Added {{MC/Cd|dataTag}} argument to {{MC/Cmd|give|link=none}}.}} | ||
|{{HistoryLine||1.8|dev=14w32a|{{ | |{{HistoryLine||1.8|dev=14w32a|{{MC/Cmd|give|link=none}} can no longer make 'illegal' stacks (such as 24 ender pearls or 5 iron swords).}} | ||
|{{HistoryLine||1.12|dev=17w16b|{{ | |{{HistoryLine||1.12|dev=17w16b|{{MC/Cmd|give|link=none}} now uses the {{MC/Cd|@s}} selector, for giving specifically yourself an item.}} | ||
|{{HistoryLine||1.17|dev=21w10a|{{ | |{{HistoryLine||1.17|dev=21w10a|{{MC/Cmd|give|link=none}} can now only give up to 100 stacks worth of items at a time.}} | ||
|{{HistoryLine||1.20.5|dev=24w09a|Replaced item NBT tag with | |{{MC/HistoryLine||1.20.5|dev=24w09a|Replaced item NBT tag with data components, therefore changing the syntax.}} | ||
}} | }} | ||
=== ''Bedrock Edition'' === | === ''Bedrock Edition'' === | ||
{{HistoryTable|{{HistoryLine|pocket alpha}} | {{HistoryTable|{{MC/HistoryLine|pocket alpha}} | ||
|{{HistoryLine||v0.16.0|dev=build 1|Added {{ | |{{HistoryLine||v0.16.0|dev=build 1|Added {{MC/Cmd|give|link=none}}. | ||
|The functionality is almost equivalent to the | |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 {{MC/Cmd|give|link=none}}.}} | ||
}} | }} | ||
== See also == | == See also == | ||
* {{ | * {{MC/Cmd|summon}} – summon any entity at any location | ||
== External links == | == External links == | ||
| Line 130: | Line 130: | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/give | |||
es:Comandos/give | |||
fr:commandes/give | |||
ja:コマンド/give | |||
pt:Comandos/give | |||
ru:Команды консоли/give | |||
uk:Команди консолі/give | |||
zh:命令/give | |||
Latest revision as of 20:11, 9 April 2026
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
- REDIRECT Template:Code
Template:Redr tag set to
- REDIRECT Template:Code
Template:Redr and its
- REDIRECT Template:Code
Template:Redr tag set to
- 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
- REDIRECT Template:Code
Template:Redr tag is set to the target and its
- REDIRECT Template:Code
Template:Redr tag is set to
- 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
- 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).
- 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).
- 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, andminecraft:keep_on_deathfunctions (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
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":
/give @p diamond_sword[lore=["Example"]] 1Template:Only
- To give all players a potion that has the Night Vision effect:
/give @a potion[potion_contents={potion:"minecraft:night_vision"}] 1Template:Only/give @a potion 1 5Template:Only
- 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:
/give @p diamond_sword 1 0 {"keep_on_death":{}}Template:Only
- 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] 2304Template:Only
History
Java Edition
Bedrock Edition
See also
- REDIRECT Template:Command
Template:Redr – summon any entity at any location
External links
de:Befehl/give es:Comandos/give fr:commandes/give ja:コマンド/give pt:Comandos/give ru:Команды консоли/give uk:Команди консолі/give zh:命令/give