Wuppy’s Minecraft Forge Modding Tutorials for 1.7: Creating your own mod: Advanced setup

Now that you know why and how the example mod works it’s time to start on your own mod. This tutorial is only for people who have the advanced setup. Otherwise follow the Standard Mod tutorial. To do this you will first have to create a new Project in your Eclipse. Right click in the Project Explorer, the window on the left with Minecraft in it, and select New and then Project. This will open up a new window in which you need to select which kind of project you want to make. To create your own mod you have to create a Java Project. Select that one and hit next. Now write a project name. For this tutorial it will be called Tutorial. Then click Finish and Ok if any windows pop up asking you things. When it is done click on the little arrow left of Tutorial and delete the src folder by right clicking it and selecting Delete and then Ok.

Next you have to make sure that the Tutorial project contains a package for all of your code. To do that right click Tutorial and select New and Package which will open up a new window in which you will have to add the name of the folder structure you will be coding in. The name should be something similar to code.com.wuppy.tutorial. Of course changing wuppy to a name you want and tutorial to the name of your mod. Then hit ok which will create the folders required for a package like that. Finally right click on the top folder which should be code. Then select Build Path and Use as source folder to change it into a package. You should then have a folder with a brown cube under it called code and in there should be a package called com.wuppy.tutorial.

Once you have created the source folder where you want all of your code right click the package in there and select New Class. The class you will make now will, at the start, be the same as the ExampleMod, but with a changed class name and package name. However, in following tutorials a lot of code will be added to the file. It is also one of the most important files in your mod so make sure you use a good name such as Tutorial in the case of a mod called Tutorial. Once you click finish you should see a file that looks like this.

Next up go to the ExampleMod file and copy over all of the code. You will now have a ton of errors in the file. To fix the one under the package select Change package declaration when hovering over it. Also change the ExampleMod in your @Mod line and class line to the class name you just made. Your file should now look something like this.

Even though all of the code should now be correct you are getting errors under all of the import lines and any of the code that uses those imports. To fix this you will have to change the build path. To do that, right click on the project and select Build Path at the bottom. Then navigate to the Projects tab and click the Add button. The project you have to add in there is the one called Minecraft. Then hit Ok, Ok and all the errors in your mod file should now be gone.

Finally there is one little change you should make. Change the MODID into whatever the name of your mod is. However, be sure to keep it lower case. For the tutorial the MODID will be tutorial. I will also remove the code in the Init method, because we won’t be using that in the actual mod. The file should then look like this.

If you want your mod to be active when launching Minecraft in your development environment go to the Run Configurations of the Client application you made in the setup tutorial and navigate to the Classpath tab. Next click User Entries and then Add Projects on the right. Then select the project in which your mod code is and uncheck the 2 boxes below. Finally hit ok. Then Apply and Run to start Minecraft with your own mod.

In the next tutorial I will show you how to add a recipe to the game. However, there are multiple other tutorial you may want to follow as well. The mcmod.info tutorial which is about a file that is very important for a good mod, the Forge update tutorial, which you will be doing quite often, the mod release tutorial even though there is not that much to release just yet or one of the Eclipse improvements and tricks tutorials which may improve your coding experience.

10 thoughts on “Wuppy’s Minecraft Forge Modding Tutorials for 1.7: Creating your own mod: Advanced setup

  1. Hello, again. I cannot find the project Minecraft when adding projects through the Configure Build Path window. All I get is ForgeMods.
    Should I use ForgeMods or did I go wrong somewhere way back?

    • You put the resources in a source folder like your code (although I suggest using a different one called resources or whatever). Accessing is exactly the same.

  2. I’m also not seeing a Minecraft folder when trying to add Projects to the build path! I don’t think I missed anything in previous tutorial pages, but all I’m seeing is my ForgeMods project in the list!

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=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">