1

When Minecraft 1.16 was released, they allowed the ability to use full hex color codes to color chat and command text.

See here: https://www.reddit.com/r/Minecraft/comments/g6dxco/snapshot_20w17a_allows_hex_codes_to_be_used_as/

I don't actually know how its used in Commands or Chat..

But I want to know how to use it in a lang file for a resource pack.

By lang file, I mean the file that contains the strings for everything in the game. Normally you can use the § formatting symbols in it. However, no one has yet to explain how its used for lang files.

Picture of a modified lang file:

Im asking this question due to someone else mentioning it: https://www.reddit.com/r/mcresourcepack/comments/htydza/how_to_i_use_new_hex_color_formatting_116_to_lang/

1 Answer 1

1

To answer this question i took a look at the mapped code from FabricMC so note that every reference to the code do not use mojangs official name for the functions and methods, however they are well documented.

when minecraft loads the .lang files it merely loads every string from a .lang file into memory. when minecraft need to draw text it calls the draw function in net.minecraft.client.font.TextRenderer which takes MatrixStack matrices, String text, float x, float y, int color and whereas some functions where we can traditionally change the color such as the chatbox give some leeway. most other screens have hardcoded values for these colors.

2
  • So basically... its not gunna happen. Unless mojang adds the functionality to parse the hex with a special code. Similarly to their § symbol which allows the original formatting colors and effects.. Ill make a bug report about the missing functionality on JIRA and see if I get a response from the mojang team. Commented Jul 21, 2020 at 12:50
  • I used your citation in a Jira Issue if thats alright: bugs.mojang.com/browse/MC-195666 Commented Jul 21, 2020 at 13:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.