What is hidden behind the scrambled text in the end poem?
The end poem - displayed after killing the ender dragon and entering the portal - contains two sections that have certain words scrambled.
It worked, with a million others, to sculpt a true world in a fold of the XXXXXX, and created a XXXXXX for XXXXX, in the XXX.
Sometimes I do not care. Sometimes I wish to tell them, this world you take for truth is merely XXXXX and XXXXXX, I wish to tell them that they are XXX in the XXXXXX. They see so little of reality, in their long dream.
Normally, such text is obtained with Minecraft's formatting codes, in particular §k
, and is unreadable for the player through any in-game means - for all intents and purposes it's gibberish and nothing more.
But if you look outside the game, the situation isn't as clear-cut. The formatting code works like all other formatting codes, by transforming the subsequent text. The only purpose for the text in this case is to determine the length of the displayed gibberish - through simple substitution;
§kXXXXX§r
will produce 5 characters worth of gibberish, and the X
can be replaced by any 5-letter text. With one special caveat: the displayed gibberish characters are the same width as the 'source' characters; §k
W§r
will produce a wider gibberish character than §k
l§r
.
But there is no inherent limitation on what the underlying text is in particular, and it is stored like any other text. It can be a secret message only accessible to someone digging through the game files.
I found the file containing the end poem. I checked what changes it underwent from 1.0 where it first appeared in an official release, until newest 1.17 snapshot. The only differences were a single one-letter typo fixed, and the name of the file changing from win.txt
to end.txt
. The contents of the entries remained the same - and just as baffling:
§3It worked, with a million others, to sculpt a true world in a fold of the §f§k§a§b§3, and created a §f§k§a§b§3 for §f§k§a§b§3, in the §f§k§a§b§3.
§2Sometimes I do not care. Sometimes I wish to tell them, this world you take for truth is merely §f§k§a§b§2 and §f§k§a§b§2, I wish to tell them that they are §f§k§a§b§2 in the §f§k§a§b§2. They see so little of reality, in their long dream.
The first thought was a disappointment. The meaning of §f§k§a§b§3
would be: §f - white text (sure these bits are white). §k - obfuscated. §a§b - two dummy color changes (green and aqua) that are no-op; §3 return to the same color as the speaker's (meaning return to standard). In Java Edition the color change resets the special formattings. My thought was the extra color changes are there as a filler to produce the characters without putting any meaningful text behind them.
But it's not that easy. The sequences are the same in both segments, only differing with the last digit, to restore the speaker's original color - §3 (dark aqua) or §2 (dark green); there are no meaningful differences there. But the output differs. The words of the first segment are 6, 6, 5 and 3 characters respectively; the second's - 5, 6, 3, 6.
The way the 'gibberish' is rendered changed 4 times in Minecraft history, but as I checked videos of the ending from different periods, these word lengths remained the same - and they are not present in end.txt
. It seems they must be somewhere else, possibly hardcoded - maybe as actual words, maybe just as character counts, or maybe even generated through some pseudorandom algorithm with a fixed seed.
So here is my question - what lies behind that scrambled text? How are these specific eight words stored or generated, as opposed to every generic §k entry everywhere else?
Note: I'm perfectly aware the text is not meant to be understood, and I fully expect the answer to be something pretty dull, like uniform strings like "aaaaaa" but I still want this secret uncovered.
Solution 1:
This is an interesting question, but I'm afraid you'll find the answer a bit underwhelming.
After the contents of win.txt
are loaded there is some processing done in the code:
- Each occurrence of
PLAYERNAME
is replaced by the actual name of the player - Each occurrence of
§f§k§a§b
is replaced by§f§kXXXX
(literal Latin Capital Letter X characters) where the number ofX
-es is randomly chosen between 3 and 6 inclusive.
So the "dummy color changes" serve as a unique placeholder marker which is replaced before rendering the text. The actual text that is rendered is just a few obfuscated X
-es.
Relevant code from the Java edition of game (I assume the bedrock edition is something similar) is in class GuiWinGame
according to MCP 9.40:
Random random = new Random(8124371L); // create a RNG with a fixed seed
String pattern = ""
+ TextFormatting.WHITE
+ TextFormatting.OBFUSCATED
+ TextFormatting.GREEN
+ TextFormatting.AQUA; // this evaluates to §f§k§a§b
while (line.contains(pattern)) { // while we keep finding the pattern
int j = line.indexOf(pattern); // find the position where pattern starts
String start = line.substring(0, j); // cut from the beginning of the line to the pattern start
String end = line.substring(j + pattern.length()); // cut from the pattern end to the end of the line
line = start
// §f§k and then cut from the 8 X-es at least 3 + 0 and at most 3 + 3 characters
+ TextFormatting.WHITE + TextFormatting.OBFUSCATED + "XXXXXXXX".substring(0, random.nextInt(4) + 3)
+ end; // assemble start + replacement + end
}