Well I guess it's time for me to and try and teach people how to mod for Minecraft again, I'm going to try and put one out everyday, as well as keep these going for a while. I do recommend you follow the golden rule of Minecraft modding:
- "Know Java before attempting to mod".
If you have any recommendations for tutorials, then please send me a PM on the forums, or go to my IRC channel @ irc.esper.net:#Asyncronous. The following mods will be for 1.7 for, at the moment it is in beta, so please be advised these are subject to change, and are to be taken with a grain of salt as to how they will function in the future.
Tutorials:
Setting Up:
To setup Minecraft Forge for development has changed, it use to be you download the "src" bindings and then run install and it sets everything up. Now the process is you still download the "src" bindings, but you have to do a few things.
Edit the build.gradle to project standards (see build.gradle spoiler)
run gradle setupDecompWorkspace
run gradle eclipse (or idea if you use intelliJ)
Open Eclipse and import the project by Import > Existing Project > (Folder where ForgeGradle is)
Setup run configuration for client and server (see client and server spoilers)
Profit
Info on how to build:
To build your project you need to open your terminal or command prompt and cd into the ForgeGradle folder, then run gradle build
build.gradle:
The required things that you need to edit are:
Version (set this to the specified version you want)
Group (this is your groupId {those that know maven or ant} follow the link in the comment on what to name it if you don't already know)
ArchivesBaseName (This is the modid of your mod)
Otherwise if you know what your doing with gradle your fine to edit whatever.
Client:
Run > Run Configurations, right click the Java Application category on the left side and select new.
Now fill in this information:
Main Class: net.minecraft.launchwrapper.Launch
Program Arguments: --version 1.7 --tweakClass: cpw.mods.fml.common.launcher.FMLTweaker --accessToken (here you can put test or get an access token {see access token})
VM Arguments: -Dfml.ignoreInvalidMinecraftCertificates=true
Server:
Do the same thing as the client, but change the main class to: cpw.mods.fml.relauncher.ServerLaunchWrapper
Access Token:
Need to research :/
Basic Mod:
package com.asyncronous.basicmod;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
@Mod(modid="basic", name="Basic Mod", version="1.0.0")
public class BasicMod{
@Mod.Instance("basic")
public static BasicMod instance;
@Mod.EventHandler()
public void preInit(FMLPreInitializationEvent event){
}
@Mod.EventHandler()
public void init(FMLInitializationEvent event){
}
@Mod.EventHandler()
public void postInit(FMLPostInitializationEvent event){
}
@Mod.EventHandler()
public void serverStarting(FMLServerStartingEvent event){
}
}
To make a standard mod you are required to have 1 class that has the annotation Mod.class (@Mod), as well as fill in the requirements for the annotation:
The "modid", is what it sounds like, the ID of the mod.
The "name", also is what it sounds like, the name of the mod.
The "version", also is what it sounds like, the version of the mod. (I use a triple number format the first is the major, the second is the minor, the third is the revision, number.
There are other properties you can fill in like: modLanguage, the language of the mod; dependencies: the dependencies of the mod.
After you fill that in, you should start making the different functions that are included in loading the mod. I've included all of the common ones, but there are more, all of them are now required to have the EventHandler.class annotation (@Mod.EventHandler {I use it to downsize the amount of imports}, or @EventHandler). An explanation of what each function does is below:
The "preInit" function, is the first function that is called in loading a mod its commonly used for configurations, the only parameter that is required is the FMLPreInitializationEvent param.
The "init" function, is the second function that is called in loading a mod its commonly used for most of the stuff contained in a mod, the only parameter that is required is the FMLInitializationEvent param.
The "postInit" function, is the third function that is called in loading a mod its commonly used for finalizing a mod, the only parameter that is required is the FMLPostInitializationEvent param.
The "serverStarting" function, is a function that is called when the server is starting initialization, its commonly used to add commands to the server, the only parameter that is required is the FMLServerStartingEvent param.
A basic mod also requires one field:
The instance field, it requires the annotation Mod.Instance.class (@Instance {or @Mod.Instance}) the annotation requires one param of the modid that you used in the Mod.class annotation. The instance field is recommended to be static. it will be initialized upon loading the mod, the initialized value will be the instance of the mod class.
Proxies:
Proxies are pretty simple, all they do is execute side dependent code. For instance in minecraft there is the client side, and server side. All you need to do to declare a proxy is create a Server proxy class for example:
package com.asyncronous.basicproxy.server;
public class ServerProxy {
public void init(){}
public void initRenders(){}
public void initTiles(){}
}
and then a client proxy class that extends the server proxy class, for example:
package com.asyncronous.basicproxy.client;
import com.asyncronous.basicproxy.server.ServerProxy;
public class ClientProxy extends ServerProxy{
@Override public void init(){}
@Override public void initTiles(){}
@Override public void initRenders(){}
}
Then when you are done with creating those classes you need to declare a field inside of the main mod class (the one that contains the Mod.class annotation {@Mod}), then add a new annotation above this field like this:
package com.asyncronous.basicproxy;
import com.asyncronous.basicproxy.server.ServerProxy;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
@Mod(modid="basic", name="Basic Proxy", version="1.0.0")
public class BasicProxy{
@Mod.Instance("basic")
public static BasicProxy instance;
@SidedProxy(clientSide="com.asyncronous.basicproxy.client.ClientProxy", serverSide="com.asyncronous.basicproxy.server.ServerProxy")
public static ServerProxy proxy;
@Mod.EventHandler() public void preInit(FMLPreInitializationEvent event){}
@Mod.EventHandler() public void init(FMLInitializationEvent event){}
@Mod.EventHandler() public void postInit(FMLPostInitializationEvent event){}
@Mod.EventHandler() public void serverStarting(FMLServerStartingEvent event){}
}
The annotation SidedProxy.class (@SidedProxy) requires 2 parameters: clientSide & serverSide.
The clientSide and serverSide parameters point to the classes that you defined just a moment ago.
How Proxies work:
Basically the proxy system in Minecraft Forge works like this:
(Mod installed on a server instance) > (Set proxy field to an instance of the serverSide class) or
(Mod installed on a client instance) > (Set proxy field to an instance of the clientSide class)
Now you can call the functions inside of the proxy class, if you override any functions inside of the ClientProxy class and you call them, they will only execute if the mod is inside of a client instance, otherwise if its inside of a server instance it will call only the ServerProxy functions
Hi, I'm guessing that you could tell me how to install some mod to minecraft. I am a basic user and just want to have fun with my three boys. We like this Doctor Who mod and Fossil-Archaeology mod.
I've watch 3-4 youtube videos and wiki all I could handle. I got over my head and hasn't worked right. any advice where to begin to mod minecraft.
- "Know Java before attempting to mod".
If you have any recommendations for tutorials, then please send me a PM on the forums, or go to my IRC channel @ irc.esper.net:#Asyncronous. The following mods will be for 1.7 for, at the moment it is in beta, so please be advised these are subject to change, and are to be taken with a grain of salt as to how they will function in the future.
Tutorials:
Setting Up:
To setup Minecraft Forge for development has changed, it use to be you download the "src" bindings and then run install and it sets everything up. Now the process is you still download the "src" bindings, but you have to do a few things.
- Download & Unzip ForgeGradle: files.minecraftforge.net/
- Download & Install (make sure to have it on your path) Gradle: http://www.gradle.org/downloads
- Open up Terminal or Command Prompt
- cd to the place where you unzip'd ForgeGradle
- Edit the build.gradle to project standards (see build.gradle spoiler)
- run gradle setupDecompWorkspace
- run gradle eclipse (or idea if you use intelliJ)
- Open Eclipse and import the project by Import > Existing Project > (Folder where ForgeGradle is)
- Setup run configuration for client and server (see client and server spoilers)
- Profit

Info on how to build:To build your project you need to open your terminal or command prompt and cd into the ForgeGradle folder, then run gradle build
build.gradle:
The required things that you need to edit are:
- Version (set this to the specified version you want)
- Group (this is your groupId {those that know maven or ant} follow the link in the comment on what to name it if you don't already know)
- ArchivesBaseName (This is the modid of your mod)
Otherwise if you know what your doing with gradle your fine to edit whatever.Client:
Run > Run Configurations, right click the Java Application category on the left side and select new.
Now fill in this information:
Server:
Do the same thing as the client, but change the main class to: cpw.mods.fml.relauncher.ServerLaunchWrapper
Access Token:
Need to research :/
Basic Mod:
package com.asyncronous.basicmod; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; @Mod(modid="basic", name="Basic Mod", version="1.0.0") public class BasicMod{ @Mod.Instance("basic") public static BasicMod instance; @Mod.EventHandler() public void preInit(FMLPreInitializationEvent event){ } @Mod.EventHandler() public void init(FMLInitializationEvent event){ } @Mod.EventHandler() public void postInit(FMLPostInitializationEvent event){ } @Mod.EventHandler() public void serverStarting(FMLServerStartingEvent event){ } }To make a standard mod you are required to have 1 class that has the annotation Mod.class (@Mod), as well as fill in the requirements for the annotation:
- The "modid", is what it sounds like, the ID of the mod.
- The "name", also is what it sounds like, the name of the mod.
- The "version", also is what it sounds like, the version of the mod. (I use a triple number format the first is the major, the second is the minor, the third is the revision, number.
- There are other properties you can fill in like: modLanguage, the language of the mod; dependencies: the dependencies of the mod.
After you fill that in, you should start making the different functions that are included in loading the mod. I've included all of the common ones, but there are more, all of them are now required to have the EventHandler.class annotation (@Mod.EventHandler {I use it to downsize the amount of imports}, or @EventHandler). An explanation of what each function does is below:- The "preInit" function, is the first function that is called in loading a mod its commonly used for configurations, the only parameter that is required is the FMLPreInitializationEvent param.
- The "init" function, is the second function that is called in loading a mod its commonly used for most of the stuff contained in a mod, the only parameter that is required is the FMLInitializationEvent param.
- The "postInit" function, is the third function that is called in loading a mod its commonly used for finalizing a mod, the only parameter that is required is the FMLPostInitializationEvent param.
- The "serverStarting" function, is a function that is called when the server is starting initialization, its commonly used to add commands to the server, the only parameter that is required is the FMLServerStartingEvent param.
A basic mod also requires one field:Proxies:
Proxies are pretty simple, all they do is execute side dependent code. For instance in minecraft there is the client side, and server side. All you need to do to declare a proxy is create a Server proxy class for example:
package com.asyncronous.basicproxy.server; public class ServerProxy { public void init(){} public void initRenders(){} public void initTiles(){} }and then a client proxy class that extends the server proxy class, for example:
package com.asyncronous.basicproxy.client; import com.asyncronous.basicproxy.server.ServerProxy; public class ClientProxy extends ServerProxy{ @Override public void init(){} @Override public void initTiles(){} @Override public void initRenders(){} }Then when you are done with creating those classes you need to declare a field inside of the main mod class (the one that contains the Mod.class annotation {@Mod}), then add a new annotation above this field like this:
package com.asyncronous.basicproxy; import com.asyncronous.basicproxy.server.ServerProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; @Mod(modid="basic", name="Basic Proxy", version="1.0.0") public class BasicProxy{ @Mod.Instance("basic") public static BasicProxy instance; @SidedProxy(clientSide="com.asyncronous.basicproxy.client.ClientProxy", serverSide="com.asyncronous.basicproxy.server.ServerProxy") public static ServerProxy proxy; @Mod.EventHandler() public void preInit(FMLPreInitializationEvent event){} @Mod.EventHandler() public void init(FMLInitializationEvent event){} @Mod.EventHandler() public void postInit(FMLPostInitializationEvent event){} @Mod.EventHandler() public void serverStarting(FMLServerStartingEvent event){} }The annotation SidedProxy.class (@SidedProxy) requires 2 parameters: clientSide & serverSide.
The clientSide and serverSide parameters point to the classes that you defined just a moment ago.
How Proxies work:
Basically the proxy system in Minecraft Forge works like this:
(Mod installed on a server instance) > (Set proxy field to an instance of the serverSide class) or
(Mod installed on a client instance) > (Set proxy field to an instance of the clientSide class)
Now you can call the functions inside of the proxy class, if you override any functions inside of the ClientProxy class and you call them, they will only execute if the mod is inside of a client instance, otherwise if its inside of a server instance it will call only the ServerProxy functions
Links:
My Github: https://www.github.com/Asyncronous
Code for these tutorials: https://www.github.c...dding-Tutorials
Esper: https://esper.net
Suggestions:
Setting Up: ProfMobius
I've watch 3-4 youtube videos and wiki all I could handle. I got over my head and hasn't worked right. any advice where to begin to mod minecraft.
Thank you for reading this,
Daddycrafty