113
Hello and welcome back the the 3rd "How to make a Minecraft mod" tutorial by TeamJaval
In this tutorial we will be looking at making a basic mod file, which will be used for everything else in your mod.
Let's get straight into it!
Next tutorial: Click Here
Index Tutorial: Click Here
After the last tutorials, you should have setup forge, the debugger and should have eclipse open, now we can get into the actual coding.
First off you must click the little arrow next to the ONLY project "Minecraft". (In the topish left corner of the eclipse window)
Then on the arrow next to src/main/java.
In there, you should see a package called com.example.examplemod
You can look in there if you want but normally you don't have to as it is no use to what we will be doing in later tutorials.
Now right click on src/main/java and click "New" then "Package".
A new window should pop up looking something like this:
For the package name you can type in something like this: "com.yourusername.modname"
Click "Finish" and now that should be done!
Now right click on the package you just created and click "New" and then "Class".
A window should pop up looking like this:
Name it your mod name with no spaces. (e.g. "TutorialMod")
Now click "Finish".
Eclipse should now look something like this:
This will be where you put alot of your mod code, although some of it will be in seperate classes.
Now, above the "public class YourModName {" line put this code:
Now there will be some errors, you can fix this by pressing Ctrl + Shift + O.
That will "import" all the neccecary classes.
Now your code should look like this:
Now below the "public class TutorialMod {" line you must put in this code:
@EventHandler
public void load(FMLPreInitializationEvent event)
{
}
Once again press Ctrl + Shift + O.
Your code should look something like this:
Now you should be able to click the little green bug at the top of the window and in the mods list, there will be your mod!
That is all for this tutorial and I will see you all in the next tutorial!
To create these tutorials for you is quite a challenge, If
you'd like to see more tutorials and more sections covered then please
donate to our team as generously as you can. Every bit of it helps and
supports us even more.
Donators will be able to get private lessons from myself or anyone else from TeamJaval. Including their name posted on numerous blogs as a big thank you.
In this tutorial we will be looking at making a basic mod file, which will be used for everything else in your mod.
Let's get straight into it!
Next tutorial: Click Here
Index Tutorial: Click Here
After the last tutorials, you should have setup forge, the debugger and should have eclipse open, now we can get into the actual coding.
First off you must click the little arrow next to the ONLY project "Minecraft". (In the topish left corner of the eclipse window)
Then on the arrow next to src/main/java.
In there, you should see a package called com.example.examplemod
You can look in there if you want but normally you don't have to as it is no use to what we will be doing in later tutorials.
Now right click on src/main/java and click "New" then "Package".
A new window should pop up looking something like this:
Spoiler
For the package name you can type in something like this: "com.yourusername.modname"
Click "Finish" and now that should be done!
Now right click on the package you just created and click "New" and then "Class".
A window should pop up looking like this:
Spoiler
Name it your mod name with no spaces. (e.g. "TutorialMod")
Now click "Finish".
Eclipse should now look something like this:
Spoiler
This will be where you put alot of your mod code, although some of it will be in seperate classes.
Now, above the "public class YourModName {" line put this code:
Spoiler
@Mod(modid="yourmodnamewithnocaseorspaces", name="Your Mod Name", version = "0.1")
Now there will be some errors, you can fix this by pressing Ctrl + Shift + O.
That will "import" all the neccecary classes.
Now your code should look like this:
Spoiler
Now below the "public class TutorialMod {" line you must put in this code:
Spoiler
@EventHandler
public void load(FMLPreInitializationEvent event)
{
}
Once again press Ctrl + Shift + O.
Your code should look something like this:
Spoiler
Now you should be able to click the little green bug at the top of the window and in the mods list, there will be your mod!
That is all for this tutorial and I will see you all in the next tutorial!
To create these tutorials for you is quite a challenge, If
you'd like to see more tutorials and more sections covered then please
donate to our team as generously as you can. Every bit of it helps and
supports us even more.
Donators will be able to get private lessons from myself or anyone else from TeamJaval. Including their name posted on numerous blogs as a big thank you.
Tags |
2838524
6
Create an account or sign in to comment.