Your First Class: The Core File
Well, now that you've set up MCP, you're probably wondering how you're going to mod (if you're new that is). So first things first, you have to make a new package. Go to File > New > Package and then title your package mymod.common and make sure that it is NOT in Minecraft/src. Instead make sure that it is in Minecraft/common. After that, repeat the process, but name it mymod.client. Put it in the same place. After you do that, create a new class inside of mymod.common and name it CoreMyMod. When that's done copy and paste this code into it. I have also put some comments in the code to guide you through. Once you're done with this tutorial, go check out the Proxies tutorial!
//This just shows your package.
package mymod.common;
//These are your imports. They basically let you use whatever method you need from them.
import net.minecraft.src.*;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
@Mod(modid = "ID of Your Mod", name = "Name of Your Mod", version = "Version of Your Mod")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class CoreModFileName
{
//Here is where you would put your public statics.
@Init
public void Init(FMLInitializationEvent event)
{
//Things like GameRegistries, LanguageRegistries, and just Registries go in here.
}
}
*You might want to change mymod to whatever your mod is going to be named lol.
//This just shows your package.
package mymod.common;
//These are your imports. They basically let you use whatever method you need from them.
import net.minecraft.src.*;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
@Mod(modid = "ID of Your Mod", name = "Name of Your Mod", version = "Version of Your Mod")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class CoreModFileName
{
//Here is where you would put your public statics.
@Init
public void Init(FMLInitializationEvent event)
{
//Things like GameRegistries, LanguageRegistries, and just Registries go in here.
}
}
*You might want to change mymod to whatever your mod is going to be named lol.