0

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?

1
  • Did you enter that exactly? That's not how you spell "locator" and that's also not the ID of the item, instead it's just a map with special data, see: minecraft.gamepedia.com/Map#ID May 4 '20 at 19:22
2

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.

1

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!

Setup

  1. Place a chest on the floor.
  2. Use /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.
  3. Manually enchant or rename your item. Use the section sign § in the anvil to colour or format your text. See the Minecraft Wiki for details on how to use it.
  4. Place the item into the chest.
  5. Create a impulse command chain with 3 steps. See this post for help on creating command chains correctly.

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]

How it Works

  1. The first command will clone the chest containing the map to the entity's position.
  2. The second command will use the destroy mode of /setblock to get rid of the chest, causing it to drop its items.
  3. The problem is, the chest itself drops too! How can we combat this? It's simple, the 3rd command. It deletes all chest item entities before the player picks them up.

Final Notes

  • If one of your items to give is a chest, it will be deleted by the 3rd command. Consider using a trapped chest instead.
0

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

1
  • Well, no, that command does not work, because that item does not exist. But apart from that, your answer is correct, it's just for example "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. May 4 '20 at 19:23
0

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.

0

(Minecraft bedrock edition)

The full syntax for the '/give' command is:

give <player> <itemName> [amount] [data] [components]

Explain the code

Player

@a - all player
@p - closest player
@s - yourself
@e - all entity
@r - random player

Item

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

Amount

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.fandom.com/wiki/Commands/give)

Data

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.fandom.com/wiki/Commands/give)

Components

There are only 4 JSON compoment

  1. minecraft:can_place_on (Only work on Adventure mode)

    /give @p stone 1 0 {"can_place_on":{"block": "grass"}}

  2. minecraft:can_destroy (Only work on Adventure mode)

    /give @p stone_pickaxe 1 0 {"can_destroy":{"block": "stone"}}

  3. minecraft:keep_on_death

    /give @p redstone 1 0 {"keep_on_death":{}}

  4. 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"}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.