Player writing § in chat gets disconnected and client freezes
This is based on MC-79813
When you use a /tellraw command or a book with JSON to let the player run a command containing "§", they will get disconnected and their client freezes.
/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"\u00a7kTest"}}
[16:36:09] [Server thread/INFO]: Marcono1234 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}}
[16:36:09] [Server thread/INFO]: Marcono1234 left the game
[16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out
[16:36:09] [Server thread/WARN]: handleDisconnection() called twice
[16:36:09] [Server thread/INFO]: Stopping server
[16:36:09] [Server thread/INFO]: Saving players
[16:36:09] [Server thread/INFO]: Saving worlds
[16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld
[16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether
[16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The End
Note: The freezing might be caused by MC-92255, however the handleDisconnection() called twice warning is unusual
Created Issue:
Player writing § in chat gets disconnected and client freezes
This is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {text:"hi",clickEvent:{action:"run_command",value:"\u00a7kHi"}}Game Output[Server thread/INFO]: Marcono1234 lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}} [Server thread/INFO]: Marcono1234 hat das Spiel verlassen [Server thread/INFO]: Stopping singleplayer server as player logged out [Server thread/WARN]: handleDisconnection() called twice [Server thread/INFO]: Stopping server [Server thread/INFO]: Saving players [Server thread/INFO]: Saving worlds [Server thread/INFO]: Saving chunks for level 'Neue Testwelt'/Overworld [Server thread/INFO]: Saving chunks for level 'Neue Testwelt'/Nether [Server thread/INFO]: Saving chunks for level 'Neue Testwelt'/The End
This is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {text:"hi",clickEvent:{action:"run_command",value:"\u00a7kHi"}}Game Output[Server thread/INFO]: Marcono1234 lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}} [Server thread/INFO]: Marcono1234hat das Spiel verlassen[Server thread/INFO]: Stopping singleplayer server as player logged out [Server thread/WARN]: handleDisconnection() called twice [Server thread/INFO]: Stopping server [Server thread/INFO]: Saving players [Server thread/INFO]: Saving worlds [Server thread/INFO]: Saving chunks for level 'Neue Testwelt'/Overworld [Server thread/INFO]: Saving chunks for level 'Neue Testwelt'/Nether [Server thread/INFO]: Saving chunks for level 'Neue Testwelt'/The EndThis is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {text:"hi",clickEvent:{action:"run_command",value:"\u00a7kHi"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The End
relates to
This is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {text:"hi",clickEvent:{action:"run_command",value:"\u00a7kHi"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The EndThis is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"\u00a7kHi"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The End
relates to
This is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"\u00a7kHi"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The EndThis is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"\u00a7kTest"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The End
This is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"\u00a7kTest"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The EndNote: The freezing might be caused by
MC-92255, but also the handleDisconnection() called twice warning is unusual
This is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"\u00a7kTest"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The EndNote: The freezing might be caused by
MC-92255,but alsothe handleDisconnection() called twice warning is unusualThis is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and his client freezes.
Command/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"\u00a7kTest"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The EndNote: The freezing might be caused by
MC-92255, however the handleDisconnection() called twice warning is unusual
relates to
Relates to
MC-92255
Cannot reproduce in 1.11
Is this still an issue in the most recent versions (currently that is 1.11) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.
This is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", he will get disconnected and
hisclient freezes.Command/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"\u00a7kTest"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The EndNote: The freezing might be caused by
MC-92255, however the handleDisconnection() called twice warning is unusualThis is based on
MC-79813When you use a /tellraw command or a book with JSON to let the player run a command containing "§", they will get disconnected and their client freezes.
Command/tellraw @p {"text":"Click","clickEvent":{"action":"run_command","value":"\u00a7kTest"}}Game Output[16:36:09] [Server thread/INFO]: Marcono1234 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}} [16:36:09] [Server thread/INFO]: Marcono1234 left the game [16:36:09] [Server thread/INFO]: Stopping singleplayer server as player logged out [16:36:09] [Server thread/WARN]: handleDisconnection() called twice [16:36:09] [Server thread/INFO]: Stopping server [16:36:09] [Server thread/INFO]: Saving players [16:36:09] [Server thread/INFO]: Saving worlds [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Overworld [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/Nether [16:36:09] [Server thread/INFO]: Saving chunks for level 'Test test'/The EndNote: The freezing might be caused by
MC-92255, however the handleDisconnection() called twice warning is unusual
duplicates
relates to
[Mod] Skylinerw, 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 [Mod] Skylinerw suggested.
Duplicates or relates to MC-79818
This is a issue which happened before 1.9 snapshots but not every time. Now in the 1.9 snapshots it seems to happen every time.
When the player gets kicked in a singleplayer world for example for invalid movement, the client freezes instead of leaving the world properly:
[20:27:39] [Server thread/WARN]: Marcono1234 was kicked for floating a vehicle too long!
[20:27:39] [Server thread/INFO]: Marcono1234 lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[20:27:39] [Server thread/INFO]: Marcono1234 left the game
[20:27:39] [Server thread/INFO]: Stopping singleplayer server as player logged out
[20:27:40] [Server thread/INFO]: Stopping server
[20:27:40] [Server thread/INFO]: Saving players
[20:27:40] [Server thread/INFO]: Saving worlds
[20:27:40] [Server thread/INFO]: Saving chunks for level 'End Test'/Overworld
[20:27:40] [Server thread/INFO]: Saving chunks for level 'End Test'/Nether
[20:27:40] [Server thread/INFO]: Saving chunks for level 'End Test'/The End
How to reproduce
Use the following command (see MC-79818):
/tellraw @p {"text":"Click me","clickEvent":{"action":"run_command","value":"\u00A7"}}
The reason
In Minecraft 1.8 (decompiled using MCP) the reason for this to happen seems to be that the initiateShutdown() method of the /Client/src/net/minecraft/server/integrated/IntegratedServer.java class is called twice. One time by the server because the hosting player left the game and the second time by the client when the main menu is loaded (or the other way around). Only the server should probably call this method.
The following displays in which order the methods are called. However this is not correct with the timing as the server calls the initiateShutdown() method after the client called it.
| Server | Client |
|---|---|
| /Client/src/net/minecraft/network/NetHandlerPlayServer.java -> kickPlayerFromServer(String reason) /** * Kick a player from the server with a reason */ public void kickPlayerFromServer(String reason) { // Client side: Packets and Channel closing //... // Server side this.netManager.disableAutoRead(); Futures.getUnchecked(this.serverController.addScheduledTask(new Runnable() { private static final String __OBFID = "CL_00001454"; public void run() { NetHandlerPlayServer.this.netManager.checkDisconnected(); } })); } |
/Client/src/net/minecraft/client/Minecraft.java -> runTick() /** * Runs the current tick. */ public void runTick() throws IOException { //... if (!this.isGamePaused && this.theWorld != null) { this.playerController.updateController(); } //... } |
| /Client/src/net/minecraft/network/NetworkManager.java -> checkDisconnected() public void checkDisconnected() { if (!this.hasNoChannel() && !this.isChannelOpen() && !this.disconnected) { this.disconnected = true; if (this.getExitMessage() != null) { this.getNetHandler().onDisconnect(this.getExitMessage()); } else if (this.getNetHandler() != null) { this.getNetHandler().onDisconnect(new ChatComponentText("Disconnected")); } } } |
/Client/src/net/minecraft/client/multiplayer/PlayerControllerMP.java -> updateController() public void updateController() { //... if (this.netClientHandler.getNetworkManager().isChannelOpen()) { this.netClientHandler.getNetworkManager().processReceivedPackets(); } else { this.netClientHandler.getNetworkManager().checkDisconnected(); } } |
| /Client/src/net/minecraft/network/NetHandlerPlayServer.java -> onDisconnect(IChatComponent reason) /** * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination */ public void onDisconnect(IChatComponent reason) { //... if (this.serverController.isSinglePlayer() && this.playerEntity.getName().equals(this.serverController.getServerOwner())) { logger.info("Stopping singleplayer server as player logged out"); this.serverController.initiateShutdown(); } } |
/Client/src/net/minecraft/network/NetworkManager.java -> checkDisconnected() public void checkDisconnected() { if (!this.hasNoChannel() && !this.isChannelOpen() && !this.disconnected) { this.disconnected = true; if (this.getExitMessage() != null) { this.getNetHandler().onDisconnect(this.getExitMessage()); } else if (this.getNetHandler() != null) { this.getNetHandler().onDisconnect(new ChatComponentText("Disconnected")); } } } |
| - | /Client/src/net/minecraft/client/network/NetHandlerPlayClient.java -> public void onDisconnect(IChatComponent reason) /** * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination */ public void onDisconnect(IChatComponent reason) { this.gameController.loadWorld((WorldClient)null); //... } |
| - | /Client/src/net/minecraft/client/Minecraft.java -> loadWorld(WorldClient worldClient) /** * unloads the current world first */ public void loadWorld(WorldClient worldClientIn) { this.loadWorld(worldClientIn, ""); } -> loadWorld(WorldClient worldClientIn, String loadingMessage) /** * par2Str is displayed on the loading screen to the user unloads the current world first */ public void loadWorld(WorldClient worldClientIn, String loadingMessage) { if (worldClientIn == null) { NetHandlerPlayClient var3 = this.getNetHandler(); if (var3 != null) { var3.cleanup(); } if (this.theIntegratedServer != null && this.theIntegratedServer.func_175578_N()) { // This should probably be only handled by the server this.theIntegratedServer.initiateShutdown(); this.theIntegratedServer.func_175592_a(); } this.theIntegratedServer = null; //... } //... } |
This is a bug where you can insert colors into the user's text prompt with command blocks (namely using /tellraw).
Example:
/tellraw @a {"text":"Click","color":"blue","clickEvent":{"action":"suggest_command","value":"\u00a7bChat was replaced with colored text"}}
Note that, when the message is sent, you will be kicked for "illegal characters in chat" or similar on servers, and the singleplayer game will freeze (which is MC-79818)

Still in 1.9.4
Still kicks the player in 1.11 but the client does not freeze anymore, probably invalid nowOn a different PCs it froze again for meHm, client doesn't freeze for me in 1.12.1. Fixed?
After some advanced testing I was able to get the "handleDisconnection() called twice" message with a direct reproduction of
MC-92255using /kick; as such this is simply a direct duplicate of that (just another case where the player was kicked).