0

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}
3
  • This is in a command block, by the way Sep 22, 2017 at 1:01
  • @Codingale please refrain from answering questions on comments (and consider moving your comment to an answer).
    – ave
    Sep 22, 2017 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! Oct 1, 2018 at 14:41

2 Answers 2

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
}
3
  • 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, 2018 at 15:47
  • 4
    It's most likely down voted since Bedrock/mcpe does not support Json components besides those commented upon by Plagiatus.
    – holroy
    Jun 17, 2018 at 3:33
  • 1
    Also, after performing these changes, the error message changes to a more informative message! Oct 1, 2018 at 14:42

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