Mojira Archive
MC-192569

Falling tile entities accept malformed text components

Minecraft contains several failsafes to prevent players from putting malformed JSON or JSON text components into commands. For example, the following command, when executed, will not accept the malformed text component and put "An unexpected error occurred trying to execute that command" into chat:

/setblock ~ ~ ~ minecraft:barrel{CustomName:"Invalid text component"}

However, there is no such failsafe for summoning a falling tile entity with a malformed text component. The following command will crash the game (or server in multiplayer) when the summoned tile entity hits the ground:

/summon minecraft:falling_block ~ ~ ~ {BlockState:

{Name:"minecraft:barrel"}

,Time:-9999,TileEntityData:{CustomName:"Invalid text component"}}

The complete crash report is attached.

Description: Ticking entity

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
	at com.google.gson.internal.Streams.parse(Streams.java:60)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:65)
	at adt.a(SourceFile:493)
	at adt.a(SourceFile:517)
	at mr$a.a(SourceFile:347)
	at cdf.a(SourceFile:35)
	at cde.a(SourceFile:46)
	at bbf.j(SourceFile:179)
	at zd.a(SourceFile:615)
	at zd$$Lambda$4358/1722165641.accept(Unknown Source)
	at bqb.a(SourceFile:603)
	at zd.a(SourceFile:405)
	at net.minecraft.server.MinecraftServer.b(SourceFile:873)
	at net.minecraft.server.MinecraftServer.a(SourceFile:813)
	at eoz.a(SourceFile:93)
	at net.minecraft.server.MinecraftServer.v(SourceFile:672)
	at net.minecraft.server.MinecraftServer.a(SourceFile:256)
	at net.minecraft.server.MinecraftServer$$Lambda$3903/1554736215.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1559)
	at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1401)
	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:593)
	at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
	at com.google.gson.internal.Streams.parse(Streams.java:46)
	... 18 more

Fixed

Saltswimmer

[Mojang] slicedlime

2020-06-28, 11:51 PM

2021-05-26, 10:57 AM

2021-05-26, 10:57 AM

3

4

Community Consensus

Very Important

Crash

1.16.1, 1.16.4

1.17 Pre-release 1