Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

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?

share|improve this question
    
BTW, Minecraft wasn't just made from scratch in Eclipse, it's an LWJGL game. –  lunboks Feb 26 '12 at 15:31
    
Welcome to the site, parioscreations. I took the liberty of changing the wording of your question to make it on-topic here (and also removed irrelevant parts in the process). We don't really cater for "how can I open .jar files" - that's not actually gaming-related - but your general desire to see Minecraft's source-code is slightly more on-topic. –  Oak Feb 26 '12 at 15:46
1  
For the down voters / closers, see this similiar question which has not been closed / down voted. –  Wipqozn Feb 26 '12 at 15:48
    
I feel pretty bad, was this a stupid question? –  parion Feb 26 '12 at 16:14
5  
@parioscreations Your original question wasn't stupid, it just wasn't on-topic for our site. –  Wipqozn Feb 27 '12 at 23:40

3 Answers 3

up vote 19 down vote accepted

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.

share|improve this answer
    
Darn. Well, can't find much here anyways. Wanted to know what made a creeper tick :( –  parion Feb 26 '12 at 15:31
    
You could always try going to the minecraft forums and ask Notch directly. –  Shadur Feb 26 '12 at 15:54
2  
@KonradRudolph I don't think it's legal. Redistribution is the one thing the Minecraft terms really forbid. However, they don't distribute the sources, they just give you a tool you can use on your own copy of Minecraft. –  lunboks Feb 26 '12 at 18:38
4  
@lunboks It's a bit of an age-old question - "We're not allowed into this bank vault, but we managed to obtain a copy of the key. I'll just leave it right here in case anyone needs it." –  Alex Sep 17 '12 at 8:23
1  
MCP is legal. They only distribute a set of translation tables and a script that runs them against your own jar files copied out of your Minecraft install. Decompiling and reverse engineering have been challenged in the courts and confirmed as legal activities in all the Bern Convention countries I'm aware of. –  SevenSidedDie Apr 20 '13 at 20:09

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."

share|improve this answer
4  
Despite that this is the reason why I bought Minecraft in the first place, I start to doubt that this is going to happen within the next decade...if ever. So, yeah, I wouldn't hold my breathe. –  Bobby Jul 15 '12 at 17:06
2  
Yeah I saw this too. But Minecraft will never die. –  parion Jul 16 '12 at 19:01

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. Check out a video I made on YouTube on setting up and installing it:

share|improve this answer
    
That video showed what to do, but was extremely frustrating to watch. –  Phoexo Jun 24 '13 at 17:58

protected by fredley May 28 '13 at 8:39

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.