Monday, December 12, 2011

MC Modding 101: Part 2: Setting up Eclipse (WINDOWS)

Welcome back to MC Modding & Hacking 101: Part 2!

NOTE: This is not a tutorial for making mods with ModLoader, if you would like me to make one for that, make a comment about it, and I may consider doing it.

Today, I'll be showing you how to setup Eclipse for MCP. I'm going off the assumption that you have read the first part, so you have all your MCP set up and all. Now, you will only need one more thing for this tutorial, Eclipse, so head over to eclipse.org/downloads/ to and download Eclipse IDE for Java EE Developers, you don't HAVE to use Eclipse, however, I do highly recommend it, and it's what I will be using.

Once you've installed/extracted Eclipse, open up eclipse.exe (or the IDE you are using.)


The text field will start off at a different workspace, so just click the "Browse" button and direct it to your mcp__/eclipse/ folder, then hit "OK". (The good thing about MCP is that they have the workspace setup already for you, so you don't have to manually add packages, etc.)

Now, you'll see a screen pop up with "Package Explorer" on it, and 2 folders that say "Client" and "Server", if you don't want to make a server mod, you can just delete that folder. For a client mod, just click the drop down arrow on "Client", then on "src" and finally on "net.minecraft.src", and you'll see this large list of .java files.



This is the Minecraft source code (De-compiled to the best of our current ability.) You can edit and these files by double clicking on one, and then you can edit anything in the file. Another great thing about Eclipse, is these 2 buttons.


The one on the left is for debugging, and the one on the right is just play. This way, you can play with your mod, and edit things without having to recompile yet, in case you make any mistakes. With debug mode, you can actually make changes, that will occur instantly, with no need to restart the game, so you can for instance, add a block to the creative mode inventory, and then open your inventory, and it will be there without having restarted the game. Very useful buttons.

Next part, I'll show you how to actually edit the game (such as add a block or something.) and then recompile and re-obfuscate.

Thursday, December 8, 2011

MC Modding 101: Part 1: Setting up MCP (WINDOWS)

Welcome to MC Modding/Hacking 101: Setting Up MCP for Windows.
I'll teach you everything you need to know in order to start hacking and modding Minecraft.

You will also need to have Java installed, as well as JDK for your appropriate Java version. Finally, set up your System Path Variables, using this tutorial, or any other you may find. Now you are ready to go!

First off, you'll want to head over to Ocean-Labs.de and download the latest version of MCP.
This will decompile Minecraft, making it much easier to read and edit.

Next, navigate to the folder you downloaded MCP to, in my case, Downloads.












Next, using Winrar or 7Zip, extract the MCP archive.












This will create a new folder, name mcp__, of course, the blanks will be numbers. But that will vary depending on the version of Minecraft/MCP you're using.

Now, navigate to your .minecraft folder, if you've never done this before, you can find it by opening "Run" from the Windows button, and typing %appdata%.













You will now see a folder called .minecraft, open it, and Ctrl+Click the two folders named "bin" and "resources", and then copy them.
















Now, you'll want to navigate back to your MCP folder, and open the "jars" folder. Next, paste the bin and resources folders into the jars folder.



Once that is all done, you are almost ready. All you need to do is run the decompile.bat in your main MCP folder. If all goes well, you should end up with a cmd window that looks identical to this.


Now you've got your code decompiled, next thing I will teach you is how to set up MCP with Eclipse, and make a basic mod.