Wuppy’s Minecraft Forge Modding Tutorials for 1.7: Set up Part 2: Forge Setup

In the last tutorial I showed you how to set up everything required to start modding with Minecraftforge. In this tutorial I will show you how to actually set up forge itself.

The first thing you have to do is download Forge from the website. You can get the right version of Forge over here. The file you want to download is the src version of Minecraft forge for 1.7. You can either go for the recommended version, but that is mostly the recommended one for mod users. I suggest downloading the newest version of Minecraftforge.

Once you have downloaded this file you should create a folder called something like ForgeMods, because you will keep all of your own code and Forge in this folder. When you have made this folder open up the zip file and paste all of the files in there. Once that is done open up a commandprompt by shift right clicking in that folder. Then run the following command.

After this you have to run another command. If, when you run this, you get an error mentioning you have to set the JAVA_HOME variable, go back to the user variables as shown in Part 1 and create a variable called JAVA_HOME. This variable has to be very similar to the PATH variable, but it shouldn’t contain the /bin part. For some reason you only need the JAVA_HOME on some pc’s.

If you are using eclipse you have to run this.

If you are an IntelliJ IDEA user the command is as follows.

IntelliJ is a similar program to Eclipse. If you are advanced enough with Java or if you have used IntelliJ for a while and prefer it you can go with that, but if you don’t know which one to choose and this is your first time programming with Java you should stick with Eclipse, because that is what I will be using in the tutorials.

Either one of these commands will download everything you need to start coding with Forge.

For Mac be sure to use ./gradlew in the place of gradlew. If you run into missing LWJGL libraries after the setup do the following things (thanks to Curlip).

run ./gradlew setupDecompWorkspace
then ./gradlew cleanCache
Then find the file at Forge-Location/build/unpacked/dev.json replace anything that says 2.9.1-nightly-20131017 with 2.9.0 NOT: 2.9.0-nightly-20131017 just 2.9.0.
Finally run ./gradlew install setupDecompWorkspace eclipse –refresh-dependencies

Once you have ran all of these commands you have to open up Eclipse and point the workspace, which pops up during startup to the eclipse folder in the ForgeMods folder you created before running the command. If you are missing the Forge library in your Eclipse after doing the setup run the following command which should fix that.

If you want to launch Minecraft in your development environment you have to click on the little arrow next to the green launch button at the top. Then select Client or Server and Minecraft should start for you.

To get to the Minecraft source code you can open the forge library which should be at the bottom of the library list. You can’t edit any of the code in there, but you can look through it to learn why and how something works in Minecraft.

You will also find a file called ExampleMod in the workspace. The code in this file will be explained in the Basic File tutorial.

If Minecraft doesn’t have sound when you start it, navigate to the eclipse folder inside of the forge folder and copy the assets folder. Then paste it within the forge folder itself and your Minecraft should have sounds.


For a more detailed explanation and much more, check out my book Sams Teach Yourself Mod Development for Minecraft in 24 Hours.

STY Minecraft Mod Development Book

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">