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

Editing a single line of a sign is no longer possible in some situations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 25w02a
    • None
    • Confirmed
    • Commands

      Due to text components being changed from strings containing JSON to NBT structures the messages lists in signs can be either a list of 4 strings or a list of 4 compounds. If all lines are unformatted, they resolve to strings.

      Due to this, it is no longer possible to replace a line with formatted text if the line current is all unformatted, because the list cannot contain a compound and 3 strings.

      This is a breaking change as before it was always 4 strings regardless of text formatting.

      Steps to Reproduce:

      1. Open a singleplayer world in 1.21.4
      2. Place a sign
      3. Stand inside of it and run
        /data modify block ~ ~ ~ front_text.messages[0] set value '{"text":"Hello","bold":true}'
      4. Observe the sign
      5. Close your game and relaunch in 25w02a then reopen the world.
      6. Destroy the sign and replace it
      7. Stand inside of it and run
        /data modify block ~ ~ ~ front_text.messages[0] set value {text:"Hello",bold:true}
      8. Observe the sign

      Observed Results:

      In 1.21.4, the bold line correctly replaces the first line. This works because you are changing the list from

      ["","","",""]

      to

      ['{"bold":true,"text":"Hello"}',"","",""]

      In 25w02a, the command that you would expect to do the same thing fails because you are essentially attempting to change

      ["","","",""]

      to

      [{bold:true,text:"Hello"},"","",""]

      which is illegal as NBT lists may only contain a single type.

      Expected Results:

      In both versions, the respective command should modify the first line of the sign to say "Hello" in bold.

            Unassigned Unassigned
            Deoxyribonucleic Evans DorkOrc
            Votes:
            13 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              CHK: