-
Bug
-
Resolution: Fixed
-
Minecraft 15w35e, Minecraft 15w44b, Minecraft 15w47c, Minecraft 16w06a, Minecraft 16w07a, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b
-
Confirmed
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"); } } //... }
- is duplicated by
-
MC-93272 Server kicks you out when running this command
- Resolved
-
MC-96806 Internal Exception io.netty.handler.codec.DecoderException (malformed JSON)
- Resolved
-
MC-100557 Wrong Json Format kicks from Server
- Resolved
-
MC-114464 /tellraw security issue
- Resolved
- relates to
-
MC-83460 JSON requires quotes around the keys in the "/title" and "/tellraw" commands and NBT tags "pages", "Text1" .. "Text4"
- Resolved
-
MC-97008 Custom Signs JSON Text Bug for Multilayer
- Resolved
-
MC-123891 NullPointerException on empty TextComponent
- Resolved