0

I'm attempting to give a player a painting named 'hel' using the following command:

give @p painting 1 0 {display:{name:"hel"}}

But I'm getting the following error:

Line 1, Column 2
Missing '}' or object member name

I've tried everything I can think of to fix it. What am I doing wrong?

Command Block Window

1

1 Answer 1

0

You are missing the quote marks (") around the attribute names in the JSON.

That is:

/give @p painting 1 0 {"display":{"name":"hel"}}

instead of:

/give @p painting 1 0 {display:{name:"hel"}}

That being said, "display" is not a supported component, so what you're trying to do wouldn't work in the first place.

According to https://minecraft.wiki/w/Commands/give

components: json (optional)‌[Bedrock Edition only]

     Like DataTags but only supports CanPlaceOn and CanDestroy functions (for example,
     /give @p iron_shovel 1 0 {"minecraft:can_destroy":{"blocks":["grass"]}})

2
  • Is there a way that I can give a rename item?
    – Piew_Piew
    Jan 5, 2020 at 5:21
  • @Piew_Piew, unfortunately, it seems that is (currently) not possible in Bedrock edition. According to a reddit thread, one workaround is to put a named item in a chest, and then clone the item to where the player is: reddit.com/r/MinecraftCommands/comments/cd19m4/…
    – Nolonar
    Jan 5, 2020 at 10:52

Not the answer you're looking for? Browse other questions tagged .