Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-124545

Malformed JSON as 'name' value for 'show_entity' hoverEvent causes crash

XMLWordPrintable

    • Confirmed

      The bug

      The game crashes if the name value of show_entity hoverEvent value is invalid JSON.

      Description: Rendering screen
      
      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 vg.a(SourceFile:493)
      	at vg.a(SourceFile:518)
      	at ho$a.a(SourceFile:241)
      	at brs.a(SourceFile:218)
      	at bqv.a(SourceFile:340)
      	at cau.a(SourceFile:990)
      	at bob.b(SourceFile:822)
      	at bob.a(SourceFile:382)
      	at net.minecraft.client.main.Main.main(SourceFile:140)
      

      How to reproduce

      1. Run the command
        /tellraw @p {"text":"hover","hoverEvent":{"action":"show_entity","value":"{\"name\":\"This is invalid JSON\",\"type\":\"minecraft:ender_crystal\",\"id\":\"00000000-0000-0000-0000-000000000000\"}"}}
        
      2. Hover over the text

            boq [Mojang] Bartosz Bok
            ValentiMS ValentiMS
            Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: