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:
Open a singleplayer world in 1.21.4
Place a sign
Stand inside of it and run
/data modify block ~ ~ ~ front_text.messages[0] set value '{"text":"Hello","bold":true}'{\code} # Observe the sign # Close your game and relaunch in 25w02a then reopen the world. # Destroy the sign and replace it # Stand inside of it and run
/data modify block ~ ~ ~ front_text.messages[0] set value {text:"Hello",bold:true}{\code}
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
["","","",""]{\code} to
['{"bold":true,"text":"Hello"}',"","",""]{\code}
In 25w02a, the command that you would expect to do the same thing fails because you are essentially attempting to change
["","","",""]{\code} to
[{bold:true,text:"Hello"},"","",""]{\code} 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.
Linked issues
is duplicated by 2
relates to 2
Attachments
Comments 6
You need to use in 25w02a the command from 1.21.4.
The following command stil works:
/data modify block ~ ~ ~ front_text.messages[0] set value '{"text":"Hello","bold":true}'
Edit: This command adds the message as a string, which means that "{"text":"Hello","bold":true}" is shown on the sign instead of "Hello"
That command puts that literal string as the sign text, the point is to put the word "Hello" but bolded, which is what's broken
Version: 25w06a
[media]
STILL BROKEN
/data modify block -73 67 -52 front_text.messages[0] set value {text:"Hello, World!",color:aqua}
Can confirm.
[media]