Difference between revisions of "Chat"
Thejoshwolfe (talk | contribs) m (→Character Set: space is also allowed.) |
m (→Colors: hexadecimal value for Yellow didn't match) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
The Notchian client has support for colorized text. To select a color, a color escape code, similar to an ANSI color escape code, is inserted to change the color of the following characters. | The Notchian client has support for colorized text. To select a color, a color escape code, similar to an ANSI color escape code, is inserted to change the color of the following characters. | ||
+ | |||
+ | [[File:Colors.png|thumb|Hex digit to color mapping]] | ||
{| class="wikitable" style="text-align:center;" border="1" cellpadding="5" | {| class="wikitable" style="text-align:center;" border="1" cellpadding="5" | ||
Line 35: | Line 37: | ||
|- | |- | ||
| bgcolor="black" | | | bgcolor="black" | | ||
− | | | + | | 0 || Black || 0 || 0 || 0 || 0 || 0 || 0 || #000000 |
|- | |- | ||
| bgcolor=#0000aa | | | bgcolor=#0000aa | | ||
− | | | + | | 1 || Dark blue || 0 || 0 || 170 || 0 || 0 || 42 || #0000aa |
|- | |- | ||
| bgcolor=#00aa00 | | | bgcolor=#00aa00 | | ||
− | | | + | | 2 || Dark green || 0 || 170 || 0 || 0 || 42 || 0 || #00aa00 |
|- | |- | ||
| bgcolor=#00aaaa | | | bgcolor=#00aaaa | | ||
− | | | + | | 3 || Dark cyan || 0 || 170 || 170 || 0 || 42 || 42 || #00aaaa |
|- | |- | ||
| bgcolor=#aa0000 | | | bgcolor=#aa0000 | | ||
− | | | + | | 4 || Dark red || 170 || 0 || 0 || 42 || 0 || 0 || #aa0000 |
|- | |- | ||
| bgcolor=#aa00aa | | | bgcolor=#aa00aa | | ||
− | | | + | | 5 || Purple || 170 || 0 || 170 || 42 || 0 || 42 || #aa00aa |
|- | |- | ||
| bgcolor=#ffaa00 | | | bgcolor=#ffaa00 | | ||
− | | | + | | 6 || Gold || 255 || 170 || 0 || 42 || 42 || 0 || #ffaa00 |
|- | |- | ||
| bgcolor=#aaaaaa | | | bgcolor=#aaaaaa | | ||
− | | | + | | 7 || Gray || 170 || 170 || 170 || 42 || 42 || 42 || #aaaaaa |
|- | |- | ||
| bgcolor=#555555 | | | bgcolor=#555555 | | ||
− | | | + | | 8 || Dark gray || 85 || 85 || 85 || 21 || 21 || 21 || #555555 |
|- | |- | ||
| bgcolor=#5555ff | | | bgcolor=#5555ff | | ||
− | | | + | | 9 || Blue || 85 || 85 || 255 || 21 || 21 || 63 || #5555ff |
|- | |- | ||
| bgcolor=#55ff55 | | | bgcolor=#55ff55 | | ||
− | | | + | | a || Bright green || 85 || 255 || 85 || 21 || 63 || 21 || #55ff55 |
|- | |- | ||
| bgcolor=#55FFFF | | | bgcolor=#55FFFF | | ||
− | | | + | | b || Cyan || 85 || 255 || 255 || 21 || 63 || 63 || #55ffff |
|- | |- | ||
| bgcolor=#FF5555 | | | bgcolor=#FF5555 | | ||
− | | | + | | c || Red || 255 || 85 || 85 || 63 || 21 || 21 || #ff5555 |
|- | |- | ||
| bgcolor=#FF55FF | | | bgcolor=#FF55FF | | ||
− | | | + | | d || Pink || 255 || 85 || 255 || 63 || 21 || 63 || #ff55ff |
|- | |- | ||
| bgcolor=#FFFF55 | | | bgcolor=#FFFF55 | | ||
− | | | + | | e || Yellow || 255 || 255 || 85 || 63 || 63 || 21 || #ffff55 |
|- | |- | ||
| bgcolor=#FFFFFF | | | bgcolor=#FFFFFF | | ||
− | | | + | | f || White || 255 || 255 || 255 || 63 || 63 || 63 || #ffffff |
|} | |} | ||
These correspond very roughly to the colors available in ANSI terminals. | These correspond very roughly to the colors available in ANSI terminals. | ||
− | A color escape code is created by combining the control character § (U+00A7) with the character specifying the color; thus, "§4" selects dark red as the color for the following text. | + | A color escape code is created by combining the control character § (U+00A7) for Minecraft Beta, or & for Minecraft Classic, with the character specifying the color; thus, "§4" in Minecraft Beta selects dark red as the color for the following text, and "&4" does the same for classic. |
=== Bugs === | === Bugs === | ||
Line 92: | Line 94: | ||
[[Category:Protocol Details]] | [[Category:Protocol Details]] | ||
− | [[Category:Minecraft | + | [[Category:Minecraft Beta]] |
Revision as of 09:03, 7 September 2011
Chat strings are subject to myriad limitations imposed by defects in the Notchian server and client, and also have special meanings for certain characters.
Character Set
The following list of characters is known to be supported by the Notchian server:
" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»"
Characters not in this list will cause Notchian servers to kick clients, and Notchian clients to choke and die horribly.
Colors
The Notchian client has support for colorized text. To select a color, a color escape code, similar to an ANSI color escape code, is inserted to change the color of the following characters.
Sample | Code | Common Name | Foreground Color | Background Color | Hexadecimal | ||||
---|---|---|---|---|---|---|---|---|---|
R | G | B | R | G | B | ||||
0 | Black | 0 | 0 | 0 | 0 | 0 | 0 | #000000 | |
1 | Dark blue | 0 | 0 | 170 | 0 | 0 | 42 | #0000aa | |
2 | Dark green | 0 | 170 | 0 | 0 | 42 | 0 | #00aa00 | |
3 | Dark cyan | 0 | 170 | 170 | 0 | 42 | 42 | #00aaaa | |
4 | Dark red | 170 | 0 | 0 | 42 | 0 | 0 | #aa0000 | |
5 | Purple | 170 | 0 | 170 | 42 | 0 | 42 | #aa00aa | |
6 | Gold | 255 | 170 | 0 | 42 | 42 | 0 | #ffaa00 | |
7 | Gray | 170 | 170 | 170 | 42 | 42 | 42 | #aaaaaa | |
8 | Dark gray | 85 | 85 | 85 | 21 | 21 | 21 | #555555 | |
9 | Blue | 85 | 85 | 255 | 21 | 21 | 63 | #5555ff | |
a | Bright green | 85 | 255 | 85 | 21 | 63 | 21 | #55ff55 | |
b | Cyan | 85 | 255 | 255 | 21 | 63 | 63 | #55ffff | |
c | Red | 255 | 85 | 85 | 63 | 21 | 21 | #ff5555 | |
d | Pink | 255 | 85 | 255 | 63 | 21 | 63 | #ff55ff | |
e | Yellow | 255 | 255 | 85 | 63 | 63 | 21 | #ffff55 | |
f | White | 255 | 255 | 255 | 63 | 63 | 63 | #ffffff |
These correspond very roughly to the colors available in ANSI terminals.
A color escape code is created by combining the control character § (U+00A7) for Minecraft Beta, or & for Minecraft Classic, with the character specifying the color; thus, "§4" in Minecraft Beta selects dark red as the color for the following text, and "&4" does the same for classic.
Bugs
The Notchian client expects that a color escape code in a chat message will be followed by at least one character, and will otherwise crash with a StringIndexOutOfBoundsException. The workaround for servers is to never end a message with a color control character.