Skip to content

Screen documentation for ~1.21.6-1.21.8: Change in functionality to color arguments in text rendering methods #340

@brainage04

Description

@brainage04

The reason why I'm making this an issue and not a PR is because as far as I'm aware, there's no documentation for 1.21.8, only 1.21 and 1.21.4. However, this specific change was made at some point in between 1.21.6 and 1.21.8, as mods I have created with 1.21.5 do not have this issue, and I'd like to make people aware of this issue so they don't question their sanity like I did for about 2 hours trying to figure out what I was doing wrong (lol).

The color arguments in text rendering methods (usually the final int argument) such as net.minecraft.client.gui.DrawContext#drawCenteredTextWithShadow(net.minecraft.client.font.TextRenderer, net.minecraft.text.Text, int, int, int) have been silently changed - previously, using a 24-bit literal (e.g. 0xFFFFFF) as the color argument would work as expected, and render the text as completely opaque white. However, at some point between 1.21.6 and 1.21.8, this functionality was silently changed, and doing this will now cause the text to be rendered as completely transparent. To render completely opaque text, you now need to use a 32-bit literal (e.g. 0xFFFFFFFF), as the color argument is now in 0xAARRGGBB format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    correctionSomething isn't right on a pagenew-versionRelated to a newer version of Minecraftpriority:highThis should be addressed before anything else

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions