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

Converting component json to snbt generates invalid output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 23w40a
    • None
    • Unconfirmed
    • (Unassigned)

      Converting this json string to a text component and then to snbt generates invalid output.

      Input: 

      {"translate":"test","with":[1, "2"]} 

      Text component toString():

      translation{key='test', args=[1, 2]} 

      String nbt output of the component:

      {translate:"test",with:[{"":1b},{"":"2"}]} 

      Exception when trying to parse the output string:

      com.mojang.brigadier.exceptions.CommandSyntaxException: Expected key at position 25: ...t",with:[{<--[HERE] 

       
      The json string to text conversion was done using ComponentSerialization.CODEC.
      The nbt string to nbt conversion was done using TagParser.parseTag().

            Unassigned Unassigned
            Lenni0451 Lennart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: