Setting the "text_opacity" NBT tag in an item display entity to anything less than 4 seemingly renders its text's opacity as 255, and setting it to 4-25 seems to render the text as completely invisible.
Steps to reproduce:
Summon a text display:
/summon text_display ~ ~1.5 ~ {text:'"Text"'}
Set its opacity to something low but still visible:
/data merge entity @e[type=text_display,limit=1] {text_opacity:26b}
Lower it by 1 down to 25:
/data merge entity @e[type=text_display,limit=1] {text_opacity:25b}
Notice the text is now completely invisible.
Set it to 1 where it should barely be visible:
/data merge entity @e[type=text_display,limit=1] {text_opacity:1b}
Notice the text is fully visible.
Attachments
Comments 6
Alpha of 4-25 being invisible is due to how core shaders for text are designed.
If you remove the following code from all text shaders, it will be visible and have the proper opacity. As such, this part of the bug is likely WAI.
if (color.a < 0.1) {
discard;
}
You can test this using the attached resource pack https://bugs.mojang.com/secure/attachment/522368/RemoveTextDisplayAlphaDiscard.zip
On the other hand, text_opacity values 0 to 3 still render fully visible. This range of values may be a bug...
Values from -128 to -1 render fully visible, but this is probably undefined behavior and WAI.
Can confirm.