Hexidecimal colors being supported for Minecraft chat?

The client itself can actually render more than those 16 base colors.

fontRenderer.drawString(string, posX, posY, hex);

Yep, itā€™s a hardcoded limitation. Chat - wiki.vg

The client can do this with like 16million colors (AARRGGBB form; ARGB ā€“ if I recall correctly), but it only decodes 16 colors from chat. A client mod would be needed to support more than 16 colors.

Now that said, a ChatColor class decoding hex color codes to one of those 16 colors would be possible.

The client uses the AARRGGBB-Form for rectangles and the RRGGBB-Form for fonts by default.

1 Like

Right, thanks for the correction. Forgot that it does not support semi-transparent fonts.

1 Like

It must, because chat text transparency is a client setting, so no itā€™s not part of the text, but yes it is possible.

Chat text transparency is a multiplayer option, right? It does not make the font transparent, it just makes the rectangles behind it more transparent.

I think it would be amazing to have, but itā€™s not a Sponge thing. It would only work on modded clients and isnā€™t really something for an API.

1 Like

True. But itā€™s still something to think about when they start development on the Sponge client.
If it was easier to convince Mojang/Microsoft to add thatā€¦

This gave me the idea that like Bukkit, Sponge should be able to send custom payload packets. Craft a packet for modded clients to handle that sends chat with more than 16 colors. (ie not part of API, but something that plugin developers can implement).

2 Likes

I totally agree. Itā€™s smething that could be handy in a lot of cases.

1 Like

Game modes like DayZ (didnā€™t someone make a server called Mine-Z or something?) would be amazing when the server and modded client can talk to each other about mods.

Also, a Sponge server can make sure that only clients with a specific mod join. Send a custom packet and expect a custom reply?

1 Like

Checking for mods is something forge already does.

Really nice idea.

1 Like

Ah right, just remembered that as I was replying in a different thread :stuck_out_tongue:

edit: Maybe the server can check for non-forge mods such as a non-forge minimap in that way that I suggested?

It does, but custom packets can, as you said, still come in really handy.

1 Like

As @TBotV63 said, Forge should already handle checking for specific mods existing on the client, but it would be nice if Sponge could implement API functions that allow mods and plugins to communicate, rather than needing to send packets and then having the mod listen for packets. Could be simplified if Sponge could mediate communications somehow. Iā€™m not a forge developer, so I may be talking out my ass a bit.

1 Like

Forge has channels for custom cross mod communication. and every mod can have a custom packet handler for itā€™s channelsā€¦ Havenā€™t worked with forge a lot lately.

1 Like

Well ainā€™t that sexy.

2 Likes

I guess all that would compliment that is a way for Sponge to mediate those forge mod packet handlers and allow us to translate that into our plugins without delving into the Forge API too much. But so far, sounds like good stuff.

1 Like