Server log outputs TextComponent object rather than its Text property for player lost connection/Disconnecting message
Every time when a player leaves the server it outputs the message to the log with the whole TextComponent object rather than just its Text-property, for example:
[19:23:55] [Server thread/INFO]: Notch 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}}
This makes the log harder to read afterwards. It's only a minor annoyance though.
I'd rather expect:
[19:23:55] [Server thread/INFO]: Notch lost connection: Disconnected
Code analysis by Marcono1234 can be found in this comment.
Environment
OS Version: Windows 8.1 64-bit
OS Language: en-US
Java Version: 1.7.0_55 64-bit
Java Vendor: Oracle Corporation
Created Issue:
Server log outputs TranslatableComponent object rather than its Text property for player lost connection/Disconnecting message
Every time when a player leaves the server it outputs the message to the log with the whole TranslatableComponent object rather than just its Text-property, for example:
[19:23:55] [Server thread/INFO]: Notch 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}}
This makes the log harder to read afterwards. It's only a minor annoyance though.Environment
OS Version: Windows 8.1 64-bit
OS Language: en-US
Java Version: 1.7.0_55 64-bit
Java Vendor: Oracle Corporation
Every time when a player leaves the server it outputs the message to the log with the whole T
ranslatableComponent object rather than just its Text-property, for example:
[19:23:55] [Server thread/INFO]: Notch 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}}
This makes the log harder to read afterwards. It's only a minor annoyance though.Every time when a player leaves the server it outputs the message to the log with the whole TextComponent object rather than just its Text-property, for example:
[19:23:55] [Server thread/INFO]: Notch 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}}
This makes the log harder to read afterwards. It's only a minor annoyance though.I'd rather expect:
[19:23:55] [Server thread/INFO]: Notch lost connection: Disconnected
Server log outputs TranslatableComponent object rather than its Text property for player lost connection/Disconnecting messageServer log outputs TextComponent object rather than its Text property for player lost connection/Disconnecting message
Every time when a player leaves the server it outputs the message to the log with the whole TextComponent object rather than just its Text-property, for example:
[19:23:55] [Server thread/INFO]: Notch 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}}
This makes the log harder to read afterwards. It's only a minor annoyance though.I'd rather expect:
[19:23:55] [Server thread/INFO]: Notch lost connection: Disconnected
Every time when a player leaves the server it outputs the message to the log with the whole TextComponent object rather than just its Text-property, for example:
[19:23:55] [Server thread/INFO]: Notch 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}}
This makes the log harder to read afterwards. It's only a minor annoyance though.I'd rather expect:
[19:23:55] [Server thread/INFO]: Notch lost connection: Disconnected
Every time when a player leaves the server it outputs the message to the log with the whole TextComponent object rather than just its Text-property, for example:
[19:23:55] [Server thread/INFO]: Notch 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}}
This makes the log harder to read afterwards. It's only a minor annoyance though.I'd rather expect:
[19:23:55] [Server thread/INFO]: Notch lost connection: Disconnected
Code analysis by Marcono1234 can be found in this comment.
The bug
Disconnecting from a server (integrated Singeplayer server as well) prints that the player was banned:
Marcono1234 lost connection: TranslatableComponent{key='multiplayer.disconnect.banned', args=[], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
Note: The fact that it prints the text component instead of the value is MC-59535.
How is this a bug? Its just gives more information about the message. You should have left a suggestion to make it better instead of reporting as a bug just because it looks bad.
It's just obvious that it's not intended...
What's the additional benefit to knowing the text "Disconnected" should not be underlined, italic, bold, have no color etc.?
With the introduction of more advanced text formatting and translation this changed to the pretty unreadable format, which I imagine is because it was forgotten to change the disconnect reason from a simple string object to the property of the TextComponent object. Before the change one could easily read the server's output on the commandline. Now it takes up 3 lines and one needs to search for the actual information.
It's just an oversight, and I want to help by making it aware.
Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. If this has been done, we can reopen the issue.
Keep in mind that the "Resolved"-Status on this ticket just means "Answered", and that we are waiting for further information on whether this issue still exists or not. We will reopen it as soon as the requested information has been delivered.
I can confirm that this is still a concern in Minecraft version 1.9
Confirmed for
Please link to this comment in the description
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta.
The reason why this happens is because the method net.minecraft.network.NetHandlerPlayServer.onDisconnect(ITextComponent) is printing the ITextComponent object instead of calling its net.minecraft.util.text.ITextComponent.getUnformattedText(), which is correctly done for example by the net.minecraft.server.network.NetHandlerLoginServer.onDisconnect(ITextComponent) method.
Affects Version 16w43a
Affects Version 1.11 16w50a
Can confirm 1.11.1
Can confirm 1.11.2