mojira.dev
MC-87281

Kicked from server when using /blockdata and /give for coloured signs

This happened when I put this command in a command block and placed the given sign:

/give @p sign 1 0 {BlockEntityTag:{Text1:" ",Text2:"{text:\"Players Remaining\",bold:\"true\",underlined:\"true\",color:dark_blue}",Text3:"{score:{name:\"Players:\",objective:\"Remain\"},bold:\"true\",color:yellow}",Text4:" "},display:{Name:"Custom Sign"}}

And the blockdata one is here:

/blockdata ~ ~ ~ {Text1:" ",Text2:"{text:\"Players Remaining\",bold:\"true\",underlined:\"true\",color:dark_blue}",Text3:"{score:{name:\"Players:\",objective:\"Remain\"},bold:\"true\",color:yellow}",Text4:" "}

The game immediately crashes and gives everyone on the server the error attached as a screenshot below.

Linked issues

Attachments

Comments

Anon Ymus

Confirmed. It is because your JSON is invalid, but that shouldn't kick all the clients.

Dominik Hauerstein

That is strange because I used the same code for the signs on an 1.8 server. Has the syntax changed in 1.9 or is there something I'm doing wrong? And I agree, it shouldn't but it does, and we won't be able to join back until I restart the server.

Anon Ymus

The syntax is the same, except the JSON must be valid JSON now, which mostly means that you must put quotes around the keys.

Dominik Hauerstein

So technically, adding quotes in the correct places should definitely work?

Anon Ymus

Yes. Of course they will have to be escaped since they are inside a string already.

marcono1234

Relates to:

marcono1234

It is actually caused by MC-87143.
Replacing the Strings for Text1 and Text4 with a proper JSON string fixes this. However since JSON parsing is strict now the keys need to be surrounded by quotes.

Replaced Text1 and Text4 (no kick)

/give @p sign 1 0 {BlockEntityTag:{Text1:"{\"text\":\" \"}",Text2:"{text:\"Players Remaining\",bold:\"true\",underlined:\"true\",color:dark_blue}",Text3:"{score:{name:\"Players:\",objective:\"Remain\"},bold:\"true\",color:yellow}",Text4:"{\"text\":\" \"}"},display:{Name:"Custom Sign"}}

Strict JSON (correct sign text)

/give @p sign 1 0 {BlockEntityTag:{Text1:"{\"text\":\" \"}",Text2:"{\"text\":\"Players Remaining\",\"bold\":true,\"underlined\":true,\"color\":\"dark_blue\"}",Text3:"{\"score\":{\"name\":\"Players:\",\"objective\":\"Remain\"},\"bold\":true,\"color\":\"yellow\"}",Text4:"{\"text\":\" \"}"},display:{Name:"Custom Sign"}}

Dominik Hauerstein

(Unassigned)

Confirmed

Minecraft 15w35b, Minecraft 15w36b, Minecraft 15w45a

Retrieved