This has probably been discussed before, but I'm wondering how to do this. The basic way for popping up a message in game is to get the EntityPlayerSP and do player.addChatMessage("blah");
But, how would I change the color of the font in that message? Is there a special code I can put in front of "blah" like "CODEblah"? I know there is some way to do this with SMP but I'm not sure how to do this on a modding level.
followed by a corresponding character will change all following text into the designated color. Here's the color codes:
0 Black
1 Dark Blue
2 Dark Green
3 Lighter Blue
4 Dark Red
5 Purple
6 Orange
7 Light Grey
8 Dark Grey
9 Another Blue
a Light Green
b Cyan
c Light Red
d Pink
e Yellow
f White
k Random Characters
Example:
\2475This Text is Purple\247eThis Text is Yellow\247fThis Text is White
followed by a corresponding character will change all following text into the designated color. Here's the color codes:
0 Black
1 Dark Blue
2 Dark Green
3 Lighter Blue
4 Dark Red
5 Purple
6 Orange
7 Light Grey
8 Dark Grey
9 Another Blue
a Light Green
b Cyan
c Light Red
d Pink
e Yellow
f White
k Random Characters
Example:
\2475This Text is Purple\247eThis Text is Yellow\247fThis Text is White
followed by a corresponding character will change all following text into the designated color. Here's the color codes:
0 Black
1 Dark Blue
2 Dark Green
3 Lighter Blue
4 Dark Red
5 Purple
6 Orange
7 Light Grey
8 Dark Grey
9 Another Blue
a Light Green
b Cyan
c Light Red
d Pink
e Yellow
f White
k Random Characters
Example:
\2475This Text is Purple\247eThis Text is Yellow\247fThis Text is White
What update does this require? I tried it on 1.7.10 and it didnt work.
This thread is two years old man. Those people above you brought it back and they're worse but yeah, it's not a lie calm the heck down, ALT+(numbers) works fine for typing unicode characters on Windows! ALT+21 does the dollar sign thing fine you're just doing it wrong (it only works on numpad, turn on numlock. If you have no numpad, use Character Map accessory and copy/paste the symbol you want).
If you want to use colors, do EnumChatFormatting instead. More info here.
But, how would I change the color of the font in that message? Is there a special code I can put in front of "blah" like "CODEblah"? I know there is some way to do this with SMP but I'm not sure how to do this on a modding level.
followed by a corresponding character will change all following text into the designated color. Here's the color codes:
0 Black
1 Dark Blue
2 Dark Green
3 Lighter Blue
4 Dark Red
5 Purple
6 Orange
7 Light Grey
8 Dark Grey
9 Another Blue
a Light Green
b Cyan
c Light Red
d Pink
e Yellow
f White
k Random Characters
Example:
\2475This Text is Purple\247eThis Text is Yellow\247fThis Text is White
Thanks so much! :biggrin.gif:
You hold the alt key and press 2 then 1 on the numpad. I think you need a numpad or ur screwed.
What update does this require? I tried it on 1.7.10 and it didnt work.
TOTAL LIE DID NOT WORK
This thread is two years old man. Those people above you brought it back and they're worse but yeah, it's not a lie calm the heck down, ALT+(numbers) works fine for typing unicode characters on Windows! ALT+21 does the dollar sign thing fine you're just doing it wrong (it only works on numpad, turn on numlock. If you have no numpad, use Character Map accessory and copy/paste the symbol you want).
If you want to use colors, do EnumChatFormatting instead. More info here.
it works