Sunday, February 26, 2012

Is there a way to see Minecraft's source code?

Question

I'm interested in browsing the Minecraft source code and see its classes - especially the code controlling the creeper. Is there a way to do that? Maybe open the minecraft.jar file and peek inside?

Answer

JAR files are simply ZIP files, so you should be able to open them with the archiving tool of your choice. Even Windows Explorer will open them if you change the file extension to .zip.

However, looking at the source isn't as easy as just unpacking the archive. It only contains the compiled .class files, and even if you do get your hands on a JVM byte code decompiler, it's obfuscated and spread out over hundreds of files.

You might want to have a look at the MCP (Minecraft Coder Pack), though. It's a community project that decompiles and (mostly) de-obfuscates the Minecraft sources to aid modders.

Answered by lunboks

No comments:

Post a Comment