113
Hello and welcome back the the 4th "How to make a Minecraft Mod" tutorials by TeamJaval.
In this tutorial we will be looking at "Creating Proxies".
Now before we get into any coding, let me explain what proxies are.
In Minecraft's case, proxies are classes that will do different things depending on whether it is on a client or a server.
Index Tutorial: Click Here
After the last tutorial you should have created a basic mod file that doesn't do anything.
First you must right click on your package (e.g. "com.gegy1000.tutorial")
and click "New", "Class".
It should open a window looking something like this:
Name this class "CommonProxy".
Then click "Finish".
Now it will display code similar to this:
Now under the "public class CommonProxy {" line, put in this code (method):
Now you must right click on your package (e.g. "com.gegy1000.tutorial")
and click "New", "Class".
It should open a window looking something like this:
Name this class "ClientProxy".
Then click "Finish".
Replace the "public class ClientProxy { ", line with:
Now your client proxy "extends" CommonProxy, which means it is a type of CommonProxy.
Now, underneath the "public class ClientProxy extends CommonProxy {" line put this code (method):
The "super.init();" line basically calls the "init" method in the CommonProxy, as it "extends" CommonProxy.
Now go back into your main mod class. (e.g. "TutorialMod")
And above the "public void load(FMLPreInitializationEvent event)" line (method) put in this code:
Press Ctrl + Shift + O and it will fix that error.
Now inside your "load(FMLPreInitializationEvent event)" put this code:
Now your mod class should look like this:
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 "Creating Proxies".
Now before we get into any coding, let me explain what proxies are.
In Minecraft's case, proxies are classes that will do different things depending on whether it is on a client or a server.
Index Tutorial: Click Here
After the last tutorial you should have created a basic mod file that doesn't do anything.
First you must right click on your package (e.g. "com.gegy1000.tutorial")
and click "New", "Class".
It should open a window looking something like this:
Spoiler
Name this class "CommonProxy".
Then click "Finish".
Now it will display code similar to this:
Spoiler
Now under the "public class CommonProxy {" line, put in this code (method):
Spoiler
public void init()
{
}
{
}
Now you must right click on your package (e.g. "com.gegy1000.tutorial")
and click "New", "Class".
It should open a window looking something like this:
Spoiler
Name this class "ClientProxy".
Then click "Finish".
Replace the "public class ClientProxy { ", line with:
Spoiler
public class ClientProxy extends CommonProxy {
Now your client proxy "extends" CommonProxy, which means it is a type of CommonProxy.
Now, underneath the "public class ClientProxy extends CommonProxy {" line put this code (method):
Spoiler
public void init()
{
super.init();
}
{
super.init();
}
The "super.init();" line basically calls the "init" method in the CommonProxy, as it "extends" CommonProxy.
Now go back into your main mod class. (e.g. "TutorialMod")
And above the "public void load(FMLPreInitializationEvent event)" line (method) put in this code:
Spoiler
@SidedProxy(clientSide = "com.yourusername.yourmodname.ClientProxy", serverSide = "com.yourusername.yourmodname.CommonProxy")
public static CommonProxy proxy;
public static CommonProxy proxy;
Press Ctrl + Shift + O and it will fix that error.
Now inside your "load(FMLPreInitializationEvent event)" put this code:
Spoiler
proxy.init();
Now your mod class should look like this:
Spoiler
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 |
tools/tracking
2839964
6
how-to-make-a-minecraft-mod-ep4-creating-proxies-modding-tutorial-series
Create an account or sign in to comment.