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

NBT tags no longer support strings when spawning entities.

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Duplicate
    • Minecraft 1.14.3
    • None
    • None
    • *Java:* openjdk:8-jre

      *JAR:* vanilla-1.14.3.jar
    • Unconfirmed
    • (Unassigned)

    Description

      Unable to spawn entities with `CustomName` due to JSON parser incorrectly parsing NBT data object.

       

      When attempting the following:

      execute at @a run summon minecraft:parrot ~1 ~1 ~1 { "CustomName": "TEST", "CustomNameVisible": 1 }
      

      The following error is thrown:

      Exception loading entity:
      m: Loading entity NBT
      at ail.f(SourceFile:1592) ~[vanilla-1.14.3.jar:?]
      at aip.a(SourceFile:432) ~[vanilla-1.14.3.jar:?]
      at p.a(SourceFile:327) ~[vanilla-1.14.3.jar:?]
      at aip.a(SourceFile:431) ~[vanilla-1.14.3.jar:?]
      at aip.b(SourceFile:484) ~[vanilla-1.14.3.jar:?]
      at aip.a(SourceFile:465) ~[vanilla-1.14.3.jar:?]
      at tp.a(SourceFile:66) ~[vanilla-1.14.3.jar:?]
      at tp.a(SourceFile:46) ~[vanilla-1.14.3.jar:?]
      at com.mojang.brigadier.CommandDispatcher.execute([CommandDispatcher.java:262|http://commanddispatcher.java:262/]) [vanilla-1.14.3.jar:?]
      at com.mojang.brigadier.CommandDispatcher.execute([CommandDispatcher.java:176|http://commanddispatcher.java:176/]) [vanilla-1.14.3.jar:?]
      Caused by: 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) ~[vanilla-1.14.3.jar:?]
      at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:65) ~[vanilla-1.14.3.jar:?]
      at zp.a(SourceFile:493) ~[vanilla-1.14.3.jar:?]
      at zp.a(SourceFile:518) ~[vanilla-1.14.3.jar:?]
      at jn$a.a(SourceFile:393) ~[vanilla-1.14.3.jar:?]
      at ail.f(SourceFile:1567) ~[vanilla-1.14.3.jar:?]
      ... 15 more
      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) ~[vanilla-1.14.3.jar:?]
      at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1401) ~[vanilla-1.14.3.jar:?]
      at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:593) ~[vanilla-1.14.3.jar:?]
      at com.google.gson.stream.JsonReader.peek(JsonReader.java:425) ~[vanilla-1.14.3.jar:?]
      at com.google.gson.internal.Streams.parse(Streams.java:46) ~[vanilla-1.14.3.jar:?]
      at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:65) ~[vanilla-1.14.3.jar:?]
      at zp.a(SourceFile:493) ~[vanilla-1.14.3.jar:?]
      at zp.a(SourceFile:518) ~[vanilla-1.14.3.jar:?]
      at jn$a.a(SourceFile:393) ~[vanilla-1.14.3.jar:?]
      at ail.f(SourceFile:1567) ~[vanilla-1.14.3.jar:?]
      ... 15 more
      

       

      However, if you replace "TEST" with a number, for example:

      execute at @a run summon minecraft:parrot ~1 ~1 ~1 { "CustomName": 1, "CustomNameVisible": 1 }

       

      The entity is spawned with its entity name as the displayed name (in this case, "Parrot").

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              SpookyTV Ryan Barr
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: