I type in /give minecraft:locater_map
, or some other /give
command, and it says
Syntax error. Unexpected ""
I keep thinking to myself: there is nothing in the quotation marks, so why do I get this error?
You must put a Target Selector
/give <target> <the item>
use @p to select the nearest player, @a for all players, @s means yourself, and @r for a random player. You can also use your name by simply writing it, but if your name contains spaces you must put quotations "" around it.
The 1st problem is, you forgot to insert a target selector between the /give
and the item ID. A target selector will specify which player to give the item to. Assuming you just want it for yourself, use @s
, which targets the executing entity.
The 2nd problem is, locator_map
is not a valid ID name. Really, a locator map is just a minecraft:map
with special data, which can't be added using commands.
But don't fret, it isn't the end of the world yet! Here's a handy trick that I've shared multiple times in the past. It's a really cool way to give someone an item with a custom name and custom enchantments. It even lets you colour the name!
/give
to give yourself the item you want. If you want to add can_place_on
and can_destroy
, now's the time to do it! See other questions/answers for help with using these in Bedrock Edition.§
in the anvil to colour or format your text. See the Minecraft Wiki for details on how to use it.Here are the commands you will need to put in each command block, in order. In these examples, replace ExpertCoder14
with your username (or a target selector), and coordinates 123, 456, 789 with your template chest's coordinates.
/execute ExpertCoder14 ~ ~ ~ clone 123 456 789 123 456 789 ~ ~ ~
/execute ExpertCoder14 ~ ~ ~ setblock ~ ~ ~ air 0 destroy
/execute ExpertCoder14 ~ ~ ~ kill @e[type=item,name=chest]
destroy
mode of /setblock
to get rid of the chest, causing it to drop its items.The syntax for the give command is:
/give <player> <itemName> [amount] [data] [components]
You forgot to give the player argument leading to a syntax error. This is the programming term for a grammar error. The unexpected " is related to the internal representation of the item name you supplied.
The following command should work just fine:
/give @s minecraft:locater_map
@s meaning yourself
map
" instead, or any other item that really exists. Locator maps are maps with special data, I don't think you can /give
them to yourself in MCBE. It might not even be possible in MCJava, because maps have a special save format.
Commented
May 4, 2020 at 19:23
you must say: /give (your username or one of the
/give (your username or one of the below) (item) (ammount wanted)
to replace your username, you can try:
-@s(yourself)
-@p(when not used with command block it means yourself, but when used with command block, it means closest player)
-@a(all players)
Example: /give @a stone 10
I hope this answered your question.
(Minecraft bedrock edition)
give <player> <itemName> [amount] [data] [components]
@a - all player
@p - closest player
@s - yourself
@e - all entity
@r - random player
Item is the name of the item to give
For me I will use DigMinecraft. Visit [https://www.digminecraft.com/lists/item_id_list_win10.php] for Minecraft item list
Specifies the number of items to give. If not specified, defaults to 1.
Must be a 32-bit integer number.
The limit: In Bedrock Edition, it must be between 1 and 32767 (inclusive).
(See https://minecraft.wiki/w/Commands/give)
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.
(See https://minecraft.wiki/w/Commands/give)
There are only 4 JSON compoment
minecraft:can_place_on (Only work on Adventure mode)
/give @p stone 1 0 {"can_place_on":{"block": "grass"}}
minecraft:can_destroy (Only work on Adventure mode)
/give @p stone_pickaxe 1 0 {"can_destroy":{"block": "stone"}}
minecraft:keep_on_death
/give @p redstone 1 0 {"keep_on_death":{}}
minecraft:item_lock
/give @p stained_glass 1 0 {"item_lock":{"mode": "lock_in_inventory"}}
/give @p stained_glass 1 0 {"item_lock":{"mode": "lock_in_slot"}}
map
with special data, see: minecraft.gamepedia.com/Map#ID