Mojira Archive
MC-279252

Changing a single line of a sign with /data is no longer possible in some situations

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.

A side-effect of this change is that it is no longer possible to replace a single line with formatted text if all lines are currently 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.

Unresolved

DorkOrc

[Mojang] Gegy

2025-01-08, 06:33 PM

2025-02-06, 10:45 AM

19

8

Confirmed

Important

Platform

Commands

25w02a, 25w05a

-