mojira.dev
MC-278442

text components only supports 'true' but not '1b'

Bold, Italic, Underlined, Strikethrough, Obfuscated only work with 'true' but not '1b' even tho its the same thing.

my main problem with this is that /data storage converts 'true' to '1b'.

so when u have a storage with data: {text:"My text",color:"gold",italic:false}
then convert it to a string with macros and set it as the lore/name the above mentioned modifiers get lost

Comments 4

this is also a problem when setting e.g. a text sign from storage.

/data modify storage global text set value {text:"test",color:"gold",underlined:true}

 

/setblock ~ ~ ~ oak_sign{front_text:{messages:['{"nbt":"text","storage":"global","interpret":true}','{"text":""}','{"text":""}','{"text":""}']}}

Invalid. Text components are JSON, not NBT; that's also why text components in NBT are within a string. JSON has strings, numbers and booleans, booleans are only true or false; 1b is not a boolean, it is the stringified representation of the NBT value 1 Byte.

To make storage work:

/data modify storage global text set value '{"text":"test","color":"gold","underlined":true}'

yes, but this has to be hardcoded. (unless you use some janky macros that convert the object to a string and replace every 1b&0b to the string true and false)

also (and this is the main problem)

{"nbt":"text","storage":"global","interpret":true}

should interpret 0b and 1b as 'true' and 'false'

What interpret does is interpret the resulting string as a json value; this does not work for objects as objects cannot be json values as they're inheritly a different format (NBT). Only strings and lists of strings can be interpreted.

Malte9799

(Unassigned)

Unconfirmed

1.21.3

Retrieved