MCPE: /give command error [duplicate]

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}

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.


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
}