Why is /data modify not editing signs correctly?
As you may or may not know, the text tags of signs are JSON text tags, meaning they have to be entered in a certain format. The only reason the custom name works is because it is also a JSON text tag. The others are not JSON text tags, so they can't be written directly to the sign text tags.
The only alternative is to use the raw JSON text nbt
element which tells the JSON text reader to check for NBT and render it. Try this:
data modify block -107 78 -525 Text2 set value '{"nbt":"Health","entity":"@e[limit=1,tag=test]"}'
data modify block -107 78 -525 Text3 set value '{"nbt":"Attributes[0].Base","entity":"@e[limit=1,tag=test]"}'
data modify block -107 78 -525 Text4 set value '{"nbt":"HurtTime","entity":"@e[limit=1,tag=test]"}'
Note that in order to correctly render the nbt
element, the system has to convert them into text
elements instead with the correct value. This is called component resolution. This resolution can only happen with signs, and some select other areas.