-2
\$\begingroup\$

So, I'm new to the Minecraft modding community and trying to understand where to start. I've attempted to do it before, but dropped it to the complexity of starting and the lack of a site like this to help (Mind that I'm also semi-new to Java, but have worked extensively in Javascript and Python. I understand how Java is different from the two).

I have downloaded MCP 9.08 (Decompiles 1.7.10), and deobfuscated Minecraft. I'm looking to mod client, so I didn't supply it with a server jar. Everything seemed to work fine in decompile (Only error was it couldn't find the server jar). I can find my files in /mcp908/src/minecraft/net/minecraft. However, if I open up one of the classes in, say, block, I see a bunch of variables starting with p_ and ending with _. Is there any way to make these variables more decipherable, to understand what's going on so I can learn by example? Thank you.

\$\endgroup\$
3
  • \$\begingroup\$ Is this the same question? \$\endgroup\$
    – Anko
    Aug 23, 2014 at 20:31
  • \$\begingroup\$ Sorry, I said decompiles instead of deobfuscated. The answer is to use MCP to deobfuscate it, and that's what I've done, and still getting the weird variables. \$\endgroup\$ Aug 23, 2014 at 22:35
  • \$\begingroup\$ Despite the text of the standard close reason, I don't think this fits on SO necessarily -- it's just a general programming question about coping with extracted "deobfuscated" variable names from tools that produce them. Luke's answer below is still pretty much the solution: you have to do it yourself (or find some documentation from somebody who has). \$\endgroup\$
    – user1430
    Aug 25, 2014 at 15:37

1 Answer 1

1
\$\begingroup\$

Mojang obfuscate their code whenever they bundle it into a .jar, which is essentially renaming all their variables and methods to gibberish, presumably to prevent others from cracking or modding it

The MCP team has done a great job of deobfuscating this code and deducting what each variable roughly means, but there are still some that are too arbitrary to understand what they do. Hence they remain obfuscated, and are just assigned a random number or string etc.

So in short, if you want to get a proper name for these variables you'll need to find out what they do/change and rename them yourself

\$\endgroup\$
2
  • \$\begingroup\$ You do not really want to rename the variables/methods from the original source code or reobfuscating the mod will not work correctly and your mod will not work. \$\endgroup\$
    – tkausl
    Aug 25, 2014 at 16:33
  • \$\begingroup\$ @tkausl is there a way to change the obfuscation mappings? \$\endgroup\$
    – Luke
    Aug 25, 2014 at 16:34

Not the answer you're looking for? Browse other questions tagged .