Before reading... this has nothing to do with How do you use colored fonts in .lang files?

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 dont actually know how its used in Commands or Chat..

But I want to know how to use it in a lang file for a reasource 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: https://imgur.com/oFRfVHk

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/


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.

  • 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. – Mister SirCode Jul 21 '20 at 12:50
  • I used your citation in a Jira Issue if thats alright: bugs.mojang.com/browse/MC-195666 – Mister SirCode Jul 21 '20 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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