コマンド/give
< コマンド
give
可視性 |
表示 |
---|---|
実行制限 |
チート有効(OPレベル2) |
対象のプレイヤーにアイテムを渡す。
- 構文
- Java Edition
/give <player>[<selectors>] <item>[<NBT>] [<count>]
(1.13 以降)/give <プレイヤー> <アイテム> [個数] [データ] [データタグ]
(1.12.2 まで)
- Bedrock Edition
/give <player: target> <itemName: string> [amount: int] [data: int] [components: components]
- 引数
- プレイヤー (BE: player: target)
- アイテムを渡すプレイヤーを指定する。プレイヤー名かターゲットセレクターを指定する。
- アイテム (BE: itemName: string)
- 個数 (BE: amount: int)(省略可能)
- 渡すアイテムの数を1から64まで指定する。何も入力しない場合、
1
として扱われる。
- 渡すアイテムの数を1から64まで指定する。何も入力しない場合、
- データ (BE: data: int)(省略可能)
- 渡すアイテムのデータ値を指定する。指定できる値は0から2,147,483,647までで、マイナスの値は0として扱われる。デフォルトでは0。
- データタグ(省略可能)、NBT[Java Edition限定]
- "components"(省略可能)[Pocket Edition限定]
- データタグ に似ているが
can_place_on
とcan_destroy
のみ指定できる。/give @p iron_shovel 1 0 {"minecraft:can_destroy":{"blocks":["grass"]}}
という風に使う。
- データタグ に似ているが
- 結果
指定した引数が正しくない場合、あるいはオンラインのプレイヤーが見つからない場合このコマンドは失敗する。
成功した場合、指定したアイテムがその分量だけ対象の位置に出現する。複数のプレイヤーを対象にした場合、それぞれが指定した分量回収する。アイテムの Owner タグは対象のプレイヤーに付与され、PickupDelay が0[要検証]の場合即座に回収される。
- 使用例
- 「Wooden planks」という説明付きのマツの木材を John というプレイヤーに30個与える。
/give John minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}}
- 暗視のポーションを John に与える。
/give John minecraft:potion 1 0 {Potion:"minecraft:night_vision"}
- アドベンチャーモードで土にのみ設置でき、ネザー水晶ブロックでのみ破壊できるダイヤモンドブロックを John に与える。
/give John minecraft:diamond_block 1 0 {CanPlaceOn:["minecraft:dirt"],CanDestroy:["minecraft:quartz_block"]}
- 耐久力Ⅲのついたネザライトの剣を John に与える。
/give John minecraft:netherite_sword{Enchantments:[{id:unbreaking,lvl:3}]}
- To summon a potion at John's location which has the Night Vision effect:
/give John potion 1 0 {Potion:"minecraft:night_vision"}
- To give Block of Diamond that can be placed on dirt and can break quartz block that can be done in adventure mode.
/give John minecraft:diamond_block 1 0 {CanPlaceOn:["minecraft:dirt"],CanDestroy:["minecraft:quartz_block"]}
歴史[編集 | ソースを編集]
Java Edition Alpha | |||||
---|---|---|---|---|---|
v1.0.15 | (Alpha server 0.1.0) /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.0 | Beta 1.9 Prerelease 4 | Added damage value argument to /give . | |||
1.3.1 | 12w16a | /give is now usable in singleplayer. | |||
1.5 | 13w04a | /give now accepts data value as the fourth argument. | |||
1.7.2 | 13w36a | Added dataTag argument to /give . | |||
1.8 | 14w32b | /give can no longer make 'illegal' stacks (such as 70 diamonds[要検証] or 5 iron swords). | |||
Pocket Edition Alpha | |||||
0.16.0 | build 1 | /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 . |
- 参照
/summon
— 任意のエンティティを任意の座標に出現させるコマンド。