When the unicode option in language is on the random text (§r) doesn't work.
/tellraw @p {"text":"Test☂","obfuscated":true}
Fix by @unknown can be found in this comment.
Linked issues
is duplicated by 3
Attachments
Comments 10
Please do not mark unreleased versions (anything starting with "Future Version") as affected. You don't have access to them yet.
I can confirm for 1.8.1-pre3.
It also doesn't display the random text in chat on unicode.
It's §k for random text though.
Steps to reproduce:
1. Get a writeable book and open it.
2. Copy paste "§kTest" into it. You should now see random text. (Unless you did step 3 already)
3. Go to the language settings and enable "Force Unicode Font"
4. Open the book again and see that the text is not random now.
Its definitely confirmed. Also, here's another way to reproduce:
Call any commands that supports "json". e.g. /tellraw. Adopt the "Obfuscated" style by something like /tellraw @a {"text":"","extra":[{"text":"MAGIC!","obfuscated":"true"}]}
. You'll first see the magical effect on the chat window. Attempt to turn on "Force Unicode Font" (or switch to a language that uses Unicode font), and then the effect is lost. The text will only appear static and as same as what you've entered.
Confirmed for
15w50a
This was partwise fixed as the default characters will be displayed now in unicode, however characters that are unicode characters by default are still not random.
The reason for this was in 1.8 that the renderStringAtPos(String p_78255_1_, boolean p_78255_2_)
method in the /Client/src/net/minecraft/client/gui/FontRenderer.java
class (MCP 1.8 names) first tested is a character is in a default character (bold ones), if so it would pass the index to the rendering method or -1 if it is not contained. Because unicode rendering is based on the unicode value of a character the rendering method needed a character being passed as well. However the character passed was always the non randomized character (this seems to be fixed now).
The problem is still that unicode characters are not randomized because they are not default characters so the game will not choose a random character for them. For 1.8 you could change the method so it would in case unicode is not forced first try to find a default character with the same width and in case it fails choose a unicode character.
/**
* Render a single line string at the current (posX,posY) and update posX
*/
private void renderStringAtPos(String p_78255_1_, boolean p_78255_2_)
{
for (int var3 = 0; var3 < p_78255_1_.length(); ++var3)
{
char var4 = p_78255_1_.charAt(var3);
int var5;
int var6;
if (var4 == 167 && var3 + 1 < p_78255_1_.length())
{
//...
}
else
{
// Changed this
//var5 = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(var4);
//
//if (this.randomStyle && var5 != -1)
//{
// do
// {
// var6 = this.fontRandom.nextInt(this.charWidth.length);
// }
// while (this.charWidth[var5] != this.charWidth[var6]);
//
// var5 = var6;
//}
// New code
// This String might be outdated
String defaultCharacters = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000";
if (this.randomStyle) {
int charWidth = getCharWidth(var4);
int defaultCharactersCount = defaultCharacters.length();
boolean chooseUnicodeChar = true;
// Prefer default characters
if (!this.unicodeFlag) {
// If the unicode flag is set, these width values are not correct anymore
ArrayList<Character> matchingDefaultCharacters = new ArrayList<Character>();
for(int index = 0; index < defaultCharactersCount; index++) {
// Eventually change this to add only the character if it is not var4
if (charWidth == this.charWidth[index]) matchingDefaultCharacters.add(defaultCharacters.charAt(index));
}
int matchesCount = matchingDefaultCharacters.size();
if (matchesCount > 1) {
// Having only the character itself will not cause any change, at least one other character is needed
chooseUnicodeChar = false;
var4 = matchingDefaultCharacters.get(this.fontRandom.nextInt(matchesCount));
}
}
if (chooseUnicodeChar) {
// Unicode character needs to be chosen
char newChar = var4;
int iterations;
for(iterations = 0; iterations < 1000; iterations++)
{
newChar = (char)this.fontRandom.nextInt(this.glyphWidth.length);
if (charWidth == getCharWidth(newChar)) break;
}
// Makes sure that the last character that did not match is not used as replacing character
if(iterations < 1000) var4 = newChar;
}
}
var5 = defaultCharacters.indexOf(var4);
// End new code
//...
}
}
}
Note: This and the rendering code could be improved by only finding the default character position if it is not already -1 or if unicode is not used.
Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time.
1.12 Pre6 snapshot
I put the following code in a command block then had it give me a sign:
give @p minecraft:sign 1 0 {BlockEntityTag:{Text1:"{\"text\":\"OH NO!\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"minecraft:tp @p 100 49 0\"},\"bold\":true,\"color\":\"dark_red\"}",Text2:"[\"\",{\"text\":\"The \"},{\"text\":\"flip\",\"obfuscated\":true,\"color\":\"aqua\"},{\"text\":\" broke.\"}]",Text3:"{\"text\":\"Right-click\"}",Text4:"{\"text\":\"this sign!\"}"},display:{Name:"End Spawn"}}
I get the following text on the resulting sign:
OH NO!
["",{"TEXT":"The
Right-click
this sign!
I suspect I'm being bit by this bug in 1.12 Pre6. I'll come up with different text.
@@unknown I cannot confirm what you are describing for 1.12-pre6. For me the second line is displayed correctly.
Edit: I suspect you are using it with a modded version of Minecraft since you are using minecraft:tp
instead of tp
or /tp
. Modded versions are not supported here.
Updated issue, excuse me for long waiting time.