- Tested Minecraft Versions:
HexChat is a library which brings an easy approach to the new Minecraft 1.16 hexadecimal colors support.
- Easy implementation of hex color codes into messages and other strings;
- Fast parsing, no regex used;
- Backward compatibility for < 1.16 versions: if hex codes are not supported it will automatically pick the nearest available color.
- Test command: /hexchat <message>
The class needed by the user is HexText, which takes a string as parameter.
An example code would be the following:
As a result:Code (Java):HexText text = new HexText("&#ff6f00Hello ȏaffHex&#fff9abChat");
And, if the server does not support hex, the codes will be automatically transformed into standard colors:
As simple as that!
Note that if the text isn't meant to be sent to a player, then it's possible to use it by chain-calling two methods plus toString():
Code (Java):String text = new HextText(...).translateColorCodes().parseHex().toString();
// Do something with text, such as scoreboards or titles
By downloading and/or using this resource, you agree to the following terms:
- You aren't allowed to claim this product as yours;
- You can use this library for paid resources. Credits are appreciated;
- You can decompile the JAR file but can't steal the source code or part of it;
- Although 1.7.10 is not officially supported, it is supposed to work. Don't leave bad reviews and don't ask for help if you are using that (old) version though.