Convert chat colors function.
#1
Is there any function to convert chat colors?
When I say chat colors I mean, when someone types
"Hi &aI &bLove &cColors"
I can just run a command and it will auto convert the &(Color Code) to a color?
I know bukkit has translateAlternateColorCodes() but I am wondering if MCServer might have any similiar function or will I need to make my own function?
Reply
Thanks given by:
#2
You don't need any translation, for chat messages it works automatically, only use @ instead of & (we need to change this, because it mangles email addresses and @mentions; just didn't get around to it).
Reply
Thanks given by:
#3
I have a motd file and it contains &(color code) colors in it, so I need to convert that string to chat colors.
Right now I am trying to convert the colors in the server desc (the desc of a server, in the server list) so I assume its just to convert them to chat colors?
Reply
Thanks given by:
#4
Unlike chat messages, the server description doesn't auto-convert colors, you need to specify them explicitly using the § character (and be careful about utf-8 encoding).
Reply
Thanks given by:
#5
hmm... So I just replace all the &(chat code) with §(chat code) no need to use cChatColor?
Reply
Thanks given by:
#6
Not really, the cChatColor is only a container for the constants, not much else.
Reply
Thanks given by:
#7
Ah, alright, thanks Smile
Oh and I was testing around with chat colors, and I noticed you cant type any formattings like
@lBold
@nUnderline
etc.

Is there a reason to this?
And thanks for the help btw Smile
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)