mojira.dev
MC-279844

SNBT text components do not accept 1b or 0b instead of booleans in some cases

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:

  1. Run

    /tellraw @s {text:"Hello World",bold:true}{\code}
    # Run

    /tellraw @s {text:"Hello World",bold:1b}{\code}

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.

Linked issues

Comments 4

Confirmed, and also 1b did work in the previous snapshot 25w03a

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version HistorySnapshot Version HistoryThe official Minecraft feedback site

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

How in the world is this intended? Text components changed to SNBT, and true/false in SNBT is an alias for 1b/0b; so why is in these specific cases of SNBT only the alias accepted?

DorkOrc

(Unassigned)

Confirmed

(Unassigned)

25w04a

Retrieved