Mojira Archive
MC-218074

Dispensers can crash the game with MalformedJsonException

If you use a dispenser to place a shulker box with a invalid CustomName NBT it results on t he game crashing with a MalformedJsonException. Placing the block by hand also throws the exception but doesn't result on crash. The eception doesn't limit to shulkerbox but any container that supports the tag, but since dispensers only can place shulker box they are the only that crashes, on vanilla.

Steps to reproduce:

  • Run
    /give @p white_shulker_box{BlockEntityTag:{CustomName:"MalformedJsonException"}}
  • Put it in a dispenser
  • Power the dispenser
  • Game crashes

Crash reports attached below. The crash reports are one of a vanilla server, and other of a debug session with yarn mappings used by FabricMC

The vanilla crash report is from the user who informed me about the issue. To understand better I ran a debug session with the game code mapped to understand what was the reason.

 * _Using right json format such as {BlockEntityTag:{CustomName:"\"MalformedJsonException\""}} and {BlockEntityTag:{CustomName:"

{"text":"MalformedJsonException"}

"}} does not result on the exception, and while the game don't allow wrong json format on entities CustomName (entity NBT), for example, it allows on CustomName inside BlockEntityTag (item NBT)_

Fixed

Awakened Redstone

[Mojang] slicedlime

2021-03-08, 12:39 PM

2021-10-14, 05:45 AM

2021-04-22, 05:08 PM

1

2

Confirmed

Very Important

Crash

1.16.5, 21w08b

21w17a