mojira.dev
MC-160766

Single quoted strings inside double-quoted JSON strings fail to parse properly

Essentially the title. To reproduce:

1. Create a new world
2. Run the command

/give @s name_tag{display:{Name:'{"text":"bob"}'}}

This gives the player a name tag named "bob", as expected.

3. Run the command

/give @s name_tag{display:{Name:"{'text':'bob'}"}}

I would expect that this either causes an error due to single quotes being disallowed by the JSON standard, or that it runs as expected, giving the player a name tag named "bob". Instead, this gives the player a name tag without a name.

Comments 1

You're right, it fails because the JSON format requires double quotes. And that's what happens for an item with any non-JSON name

Ely G

(Unassigned)

Unconfirmed

(Unassigned)

1.14.4

Retrieved