-
Bug
-
Resolution: Works As Intended
-
None
-
25w04a
-
None
-
Confirmed
-
(Unassigned)
Text components written with SNBT require booleans to be explicitly written as true or false and do not accept 1b or 0b respectively when written in commands that expect a text component such as /tellraw, /title, /scoreboard, /team, and /bossbar.
This means it is impossible to write a text component containing a boolean (stored as a byte in NBT) into a command using a macro as they will always write the data as a byte, not as a boolean.
This does not affect the nbt text component as when it reads the NBT data, it will automatically interpret a 0 or 1 as a boolean in the correct context. This is specifically an issue for commands that bypass NBT entirely, only using the SNBT format as syntax for the input.
This breaks functionality in several places in the game that require macros to enter dynamic text as they do not resolve their text component automatically. For example, scoreboard objective names, scoreholder/numberformat names and styles, team names, and team affixes.
Steps to Reproduce:
- Run
/tellraw @s {text:"Hello World",bold:true}
- Run
/tellraw @s {text:"Hello World",bold:1b}
Note: The second command is what you would expect a macro function to write when it receives this data (as a compound) as a macro variable. However, you do not need to make a whole data pack containing a macro to observe the core issue here, as it is to do with how the command is read which macros and chat commands do identically.
Observed Result:
The version with true is parsed as expected but the version with 1b results in a failure/error.
Expected Result:
Both commands function the same because bytes (and other numerical types) are accepted and interpretted as booleans when reading a text component stored as NBT, and there is no way to write a boolean with macros in this way.
- relates to
-
MC-279971 lodestone_tracked pos and profile id require explicit int list snbt qualifier
- Resolved