-
Bug
-
Resolution: Fixed
-
1.19, 22w24a
-
None
-
Confirmed
-
Social Interactions
-
Normal
If a run_command click event that has a new character ( \n ) causes the player to get kicked from the world and displays the `Illegal characters in chat` screen
Steps to Reproduce:
- Create a singleplayer world (make sure to enable cheats).
- Paste the following command into the chat. Then press enter.
/tellraw @s [{"text":"Click me!","clickEvent": {"action":"run_command","value": "/tellraw @s [{\"text\":\"Players:\n\"},{\"color\":\"gray\",\"selector\":\"@a\"}]"} }]
- Open chat and press `Click me!`
Observed Results:
- The world closes and displays the `Connection lost, Illegal characters in chat` screen after pressing the text.
- Removing the `\n` character from the run command event causes the command to run.
- Double escaping the new line character seems to fix it.
/tellraw @s [{"text":"Click me!","clickEvent": {"action":"run_command","value": "/tellraw @s [{\"text\":\"Players:\\n\"},{\"color\":\"gray\",\"selector\":\"@a\"}]"} }]
- Putting the new line character in the main tellraw command properly works.
/tellraw @s {"text":"Hello\nWorld"}
Expected Results:
- The click event properly runs the tellraw command and displays all active players.