mojira.dev
MC-79813

JSON unicode decoding bug

When you use the JSON format for example by executing the /tellraw command, you will notice that Minecraft decodes the complete string instead of the values for each text tag. This means you can create commands like

/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"/say \u02ac"}}

Chat: [Marcono1234] ʬ
Which wouldn't be possible normal because only commands in the JSON format get decoded.

Possible way of fixing it:
Minecraft should only decode the value of the text tag of JSON strings

If you remove this Mojang developers, could you please add another way to summon entities or add scoreboard objecitves with colored names instead please?

Linked issues

Comments

StevenNL2000

You are forgetting the most important part of the bug! From http://redd.it/33h76n :

There is however a little problem: You can only use signs to run the command. Any other method will disconnect the player who clicked on the text from the server and freezes his client

Example command for that:

/tellraw @p {text:"Click",clickEvent:{action:"run_command",value:"/summon Item ~ ~1 ~ {Item:{id:dirt,Count:1,tag:{display:{Name:\u00a7cTest\u00a7r}}}}"}}

The freeze creates the following in the log files:

[21:44:44] [Server thread/INFO]: StevenNL2000 lost connection: TextComponent{text='Illegal characters in chat', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[21:44:44] [Server thread/INFO]: StevenNL2000 left the game
[21:44:44] [Server thread/INFO]: Stopping singleplayer server as player logged out
Skylinerw

@StevenNL2000 Are you using vanilla? In both vanilla singleplayer and multiplayer, you get kicked from the world (not frozen) for the very reason in that log: "Illegal characters in chat". That's an intentional kick, not a bug. If you're freezing in a vanilla environment, you may need to make a separate report.

@OP I'm not sure this qualifies as a bug as much as a feature suggestion. Restricting to 'text' prevents unicode usage in hoverEvent hover texts (which uses JSON text component), clickEvent values (which can be used to run a /tellraw command that uses unicode), and most importantly in translations. I'd suggest the minecraftsuggestions subreddit instead.

StevenNL2000

@unknown, this was tested in a vanilla environment. The logs show a kick, but that's not what happens on the client. The client just freezes as soon as you click on the text, and there is no way to recover it without forcefully ending the task. Also, the only reason this freeze happens is because the unicode characters are being decoded, so it's definitely part of this bug.

Your statement about unicode being decoded at all outside of text: being intended may be valid, the freezing is definitely not intended.

MC-79818 has been created to account for the freezing issue, which is a valid bug. This issue may however be intended, as @unknown suggested.

marcono1234

michael

Unconfirmed

JSON, decode, decoding, json, unicode

Minecraft 1.8.4, Minecraft 15w37a, Minecraft 15w39c, Minecraft 15w47a

Retrieved