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

    Details

    • Confirmation Status:
      Confirmed

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                boq [Mojang] Bartosz Bok
                Reporter:
                ValentiMS ValentiMS
              • Votes:
                6 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: