51

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?

1

4 Answers 4

38

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 MCP (Mod Coder Pack, formerly Minecraft Coder Pack), though. It's a community project that decompiles and (mostly) de-obfuscates the Minecraft sources to aid modders.

0
13

There's a way to do this; in fact, this way as well allows you to edit the code and... make your own mods! It's called MCP (Minecraft Coders' Pack), and is a bit of a complicated setup, but it is how nearly all Minecraft mods are made.

2
  • 2
    That video showed what to do, but was extremely frustrating to watch.
    – Phoexo
    Commented Jun 24, 2013 at 17:58
  • 1
    The video shows "this video is private" so nobody can watch it
    – Radon8472
    Commented Aug 14, 2022 at 6:35
8

Interestingly enough, mention of source code release comes straight from the minecraft website.

"Once sales start dying and a minimum time has passed, I will release the game source code as some kind of open source. I'm not very happy with the draconian nature of (L)GPL, nor do I believe the other licenses have much merit other than to boost the egos of the original authors, **so I might just possibly release it all as public domain.**"

1
  • 2
    This aged poorly
    – arkon
    Commented Jun 2, 2022 at 5:00
3

For 1.7 - 1.12, you can use Mod Coder Pack.

For 1.13+, you can use MCP-Reborn.

You must log in to answer this question.

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