Modding Minecraft 1: Setting up Minecraft Coders Pack (MCP)

Hi there,

Yay! A few days ago Notch confirmed the “modding API” (the complete unobfuscated Minecraft courcecode) for Version 1.7 (test) or, I guess, 1.8 (public).

But that may be quite a while, so the first step to Minecraft Modding still is setting up the MCP.

The Minecraft Coders Pack is a community-based and community-updated Project to make Minecraft Modding less of a chore. It has scripts and files which automagically decompile and de-obfuscate  minecraft.jar and minecraft_server.jar. It also has scripts to recompile and re-obfuscate your changed or added Classes. These classes then can be added to an official minecraft.jar and will work within the game.

It’s my guess that the MCP will support the official source of Minecraft (some time after it has been released).

As I use Windows 7, this Tutorial will be about the set-up process in Windows, but on Linux it is not so different. Instead of Downloading and installing the prerequisites, you can just install them with the package manager of your Distro (e.g. aptitude, yum).

1. Prerequisites

You need to download and install the following prerequisite programs:

If you’re on a 64bit Machine, I recommend you install the x86 JDK. (x64 Java is only useful if you need more than 2GB of RAM).
If you already have everything installed, skip to Step 2.
Now to check if it all works, open up a command prompt
Press Windows-R
type "cmd"
hit enter

Now a black window should pop up.

There you need to type the following commands which should give a similar respons:


python -V

which should print

 Python 2.7.1  

and


python -c "import platform; print(platform.architecture())"

which should print

 ('32bit', 'WindowsPE') 

Now everything is set up for the MCP.

2. Getting the Coders Pack

Go to this page and download MCP 4.1 for Minecraft 1.6.6.

Then extract it to a folder of your choice (this is your development Folder, place it in a convenient location, e.g. C:\mcp).

The content of the folder should look like this:

3. Setting up the Jar-Files

Now you need to copy the “bin” folder from


%appdata%/.minecraft

to the jars folder in the MCP Folder (e.g. to C:\mcp\jars)

If you want to mod the server, you need to copy (or download and copy) minecraft_server.jar to the jars folder.

Note: It is recommended that you use an unmodified minecraft.jar. But if you want to make Mods that use Risugami’s Modloader (highly recommended), you will not get around using the MCP with a modified jar (It will complain and display 2 errors in the File RenderBlock.java but it works).

4. Decompile and Deobfuscate

To decompile and debobfuscate just doubleclick on the file “decompile.bat”.

If it tells you that an update is available, shut it down (ctrl-c), doubleclick on “updatemcp.bat” and type “Yes” when asked. Then doubleclick on “cleanup.bat” and again type “Yes” when asked. Then doubleclick on “decompile.bat” again and leave it until it stops.

5. Mod and test Minecraft

This will be covered in a different, later Post.

6. Recompile and reobsfuscate

This is, again, nearly as simple as doubleclicking 2 bat-files.

First run “recompile.bat”. This will compile all the source, including your changes and additions. Unfortunately as of version 4.1 this also compiles a few classes for developing with Eclipse (which are only needed within eclipse). So we need to delete those classes (don’t worry, everything in eclipse will still work fine).

In the MCP Folder, navigate to


bin\minecraft

and delete all Files containing “Start” (4 in total).

Next run “reobfuscate.bat” and wait until it finishes. It lists all changed Files and outputs them to the folder named “reobf”.

Now your mod can be used with the official minecraft.jar. Just copy the your files from “reobf” to a some folder (e.g. with the name of your mod).

Congratulations: You have your first mod which is compatible with the official minecraft.jar!

Here you can easily look at the screens.

About these ads

3 thoughts on “Modding Minecraft 1: Setting up Minecraft Coders Pack (MCP)

  1. Pingback: Modding Minecraft 2: First Block | Another Random Blog

  2. Hey there! I’ve been reading your web site for some time now and finally got the courage to go ahead and give you a shout out from Huffman Tx! Just wanted to say keep up the excellent work!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s