0

This question already has an answer here:

I found out that on the MCPE 1.2 update, Mojang added components to commands. But when I try to enter

/give @p diamond_sword 1 0 {
display: {
    Name: "Sword of Ethania",
    Lore: [
        "Legendary",
        "The Guardian Sword that defends Ethania"
    ]
},
ench: [
    {
        id: 16,
        lvl: 1
    },
    {
        id: 17,
        lvl: 1
    },
    {
        id: 18,
        lvl: 1
    },
    {
        id: 19,
        lvl: 1
    },
    {
        id: 20,
        lvl: 1
    },
    {
        id: 32,
        lvl: 1
    },
    {
        id: 34,
        lvl: 1
    }
],
HideFlags: 1,
Unbreakable: 1
}

then I get this error message:

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

Please help me debug, I have found nothing wrong in the command. Minimized Version:

/give @p diamond_sword 1 0 {display:{Name:"Sword of Ethania",Lore:["Legendary","The Guardian Sword that defends Ethania"]},ench:[{id:16,lvl:1},{id:17,lvl:1},{id:18,lvl:1},{id:19,lvl:1},{id:20,lvl:1},{id:32,lvl:1},{id:34,lvl:1}],HideFlags:1}

marked as duplicate by Nelson, Schism, greg-449, Joachim, galacticninja Jul 10 at 11:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • This is in a command block, by the way – PixelatedMike Sep 22 '17 at 1:01
  • @Codingale please refrain from answering questions on comments (and consider moving your comment to an answer). – Ave Sep 22 '17 at 13:58
  • This is a valid question. There is very little explicit documentation detailing the reason why in Minecraft Bedrock Edition, they can't do much! – User that is not a user Oct 1 '18 at 14:41
2

I know this is an old question but in case anyone refers to this in the future:

As of the latest mcpe version (1.2.10) the only components that have been added to the game are can_place_on and can_destroy. all other modifications (names, lore) have to be done through external editors or afterwards ingame through the enchant command.

Thus what you're trying to do with this command is currently impossible.

1

Have you tried wrapping the keys in quotes like "key":"value"

Here's the formatted code:

/give @p diamond_sword 1 0 {
    "display": {
        "Name": "Sword of Ethania",
        "Lore": [
            "Legendary",
            "The Guardian Sword that defends Ethania"
        ]
    },
    "ench": [{
            "id": 16,
            "lvl": 1
        },
        {
            "id": 17,
            "lvl": 1
        },
        {
            "id": 18,
            "lvl": 1
        },
        {
            "id": 19,
            "lvl": 1
        },
        {
            "id": 20,
            "lvl": 1
        },
        {
            "id": 32,
            "lvl": 1
        },
        {
            "id": 34,
            "lvl": 1
        }
    ],
    "HideFlags": 1,
    "Unbreakable": 1
}
  • 1
    Can I inquire why exactly this was voted down? By the JSON standard it's technically required to have the keys in quotes under RFC 4627, RFC 7159 and even ECMA-404. – Codingale Feb 25 '18 at 15:47
  • 3
    It's most likely down voted since Bedrock/mcpe does not support Json components besides those commented upon by Plagiatus. – holroy Jun 17 '18 at 3:33
  • 1
    Also, after performing these changes, the error message changes to a more informative message! – User that is not a user Oct 1 '18 at 14:42

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