The bug
When this command is executed:
/title @a title []
it kicks me from the world/server and displays this error:
Internal Exception: io.netty.handler.codec.DecoderException: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
In 1.8 the command was working.
Code analysis
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
This bug would be fixed by using the "fix" provided for MC-55373.
The reason why this happens is because the method net.minecraft.util.text.ITextComponent.Serializer.deserialize(JsonElement, Type, JsonDeserializationContext)
returns null
when parsing an empty array because it only sets the chat component which should be returned to a value if the array contains items.
public ITextComponent deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException
{
if (p_deserialize_1_.isJsonPrimitive())
{
return new TextComponentString(p_deserialize_1_.getAsString());
}
else if (!p_deserialize_1_.isJsonObject())
{
if (p_deserialize_1_.isJsonArray())
{
JsonArray jsonarray1 = p_deserialize_1_.getAsJsonArray();
ITextComponent itextcomponent1 = null;
// No items are in the array meaning "itextcomponent1" stays "null"
for (JsonElement jsonelement : jsonarray1)
{
ITextComponent itextcomponent2 = this.deserialize(jsonelement, jsonelement.getClass(), p_deserialize_3_);
if (itextcomponent1 == null)
{
itextcomponent1 = itextcomponent2;
}
else
{
itextcomponent1.appendSibling(itextcomponent2);
}
}
return itextcomponent1;
}
else
{
throw new JsonParseException("Don\'t know how to turn " + p_deserialize_1_.toString() + " into a Component");
}
}
//...
}
Linked issues
is duplicated by 4
relates to 2
Attachments
Comments 17


There is no crash, just a kick,

Ah, I see, just for anyone else reading, the report previously said crash

That's true:
@unknown made changes - an hour ago
Summary | Crash on this command: /title @a title [] | Server kicks client when executing: /title @a title [] |

Can confirm the issue affects LAN and Server in latest snapshots to date.
(Latest Checked: 15w44b)
I do believe that similar issues occurred in snapshots last year before final release, the final release (or later snapshots) stated that finally the title command was fixed.

This bug still works in 1.11 servers. The worst part is that you can use /tellraw Username [] to kick someone. This is annoying because people use it in realms and /kick does not work there. Please fix it in 1.11.1

Confirmed for 1.11.2

confirmed for 17w13b

Cannot reproduce in 17w50a, instead I get this message in the chat: java.lang.NullPointerException
As for 1.13-pre3 I get the error feedback message
Invalid chat component: empty
Therefore, cannot be reproduced any longer.
Attach the full crash report