Note: If you are posting a forum or video tutorial from this tutorial forum leave credit to me by posting the link to this forum and the name of the maker of this forum please do not steal my work even with the source file that is release.
This is forge modding tutorials for you to experiment with and use. I'll be showing you how to make basic to advanced mods.
To setup forge into eclipse you must first download the source and extract. Once extracted go into the folder and install.Then open eclipse and go to file - switch workspace and find the folder you just installed witch be forge/mcp/eclipse and then open but it wont exactly say forge/mcp/eclipse it will have your computer name and were ever the folder is located like this C:\Users\ComputerName\Desktop\Forge Test Tutorial\forge\mcp\eclipse.
Now since we have eclipse and forge ready we can begin modding our minecraft to make mods.
Step 1.
To create your mod you need to create a new package. On the left there will be a minecraft folder. Click the + sign next to the miencraft folder and it will extend down with other folders. Now you will see a folder called src do the same thing click the + sign. Once it fully extends down you can begin. Right click src and and hover your mouse over new and and go to were it says Package. The package is going be the name of your mod but since 1.5. came out you will need to name your package mods.YourModNameMain. All lower cases for mods and then put a period and then your mod name.
Now you will need to make a few more packages to get started. Just do the same thing you did with mods.YourModNameMain. Or just copy and paste these when you selected a new package to create. Press Ctrl + C to copy. And press Ctrl + V to paste.
To make a class right click the package you want the class file to be in and select new - class and then name it what you want YourModName. And if you don't know what a class file is we'll it is simply the code of your mod.
First we are going make a new class in this package mods.YourModName.Client to get this out of the way and to do so you are going need to right click mods.YourModName.Client and create a new class and call the class file ClientProxyTest Once that is done you are going want to copy and paste this code into your class file.
package mods.Test.Client;
import cpw.mods.fml.client.registry.RenderingRegistry;
import mods.Test.Common.CommonProxyTest;
import net.minecraftforge.client.MinecraftForgeClient;
public class ClientProxyTest extends CommonProxyTest{
@Override
public void registerRenderThings(){
}
@Override
public int addArmor(String armor)
{
return RenderingRegistry.addNewArmourRendererPrefix(armor);
}
}
Next we are going make a class in this package mods.YourModName.Common to do so just do the same thing you did with the other class. Now copy and paste this code once you have your class made.
package mods.Test.Common;
public class CommonProxyTest {
public void registerRenderThings(){}
public int addArmor(String armor) { return 0; }
}
Now we are going to make the main class for your mod. This class will have many things just think of it as your base mod. Create a new class in mods.YourModName.Common and call the class TestMain and hit finish. Once you have your main class for your mod you are going to copy this code and paste into your class.
package mods.Test.Common;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
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.network.NetworkMod;
//---------------------------------------------------------------------------------------------------------------------------------
//Name of the mod and the version of your mod.
//Client side should stay true. Server side should stay false (If server side is true then only people that have your mod installed can join)
@Mod(modid = "TestMod", name = "Test", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class TestMain {
//---------------------------------------------------------------------------------------------------------------------------------
@Instance("TestMod")
public static TestMain instance;
//---------------------------------------------------------------------------------------------------------------------------------
@SidedProxy(clientSide="mods.Test.Client.ClientProxyTest", serverSide="mods.Test.Common.CommonProxyTest")
public static CommonProxyTest proxy;
//---------------------------------------------------------------------------------------------------------------------------------
@PreInit
@Init
public void init(FMLInitializationEvent event) {
proxy.registerRenderThings();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@PostInit
public static void postInit(FMLPostInitializationEvent event) {
Now since we have the basic stuff that is needed to get started we can now start making mods and from here on out every class we make will be going into the mods.Test.Common package area unless later on I say we are going change it. And add something into a different package.
1. Blocks
The blocks you see in minecraft but this will show you how to make your own blocks in minecraft.
Make a new class in mods.Test.Common and call it TestBlockOre then press finish. Once you have done so you are going copy this code and paste it into your test block
NOTE! If you so happen to be usuing the 1.5.1 forge build then this texture is not advise to use as it will give error. But if you are usuing 1.5 then this texture is correct for usage.
package mods.Test.Common;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
public class BlockTestOre extends Block{
public BlockTestOre(int id, Material mat) {
super(id, mat);
this.setCreativeTab(CreativeTabs.tabBlock);
}
@Override
public void func_94332_a(IconRegister iconReg){
this.field_94336_cN = iconReg.func_94245_a("RpgSoundMaker:BlockButtonOre");
}
}
For the 1.5.1 texture replace this code
@Override
public void func_94332_a(IconRegister iconReg){
this.field_94336_cN = iconReg.func_94245_a("Test:test");
}
}
And put this instead. It will fix the 1.5.1 texture code.
The first Test is the package of the mod. The second is the png file name for your texture.
Now you are going want to go back to your Main base mod. TestMain and add a few code such as listed below.
Put this code in @Sided Proxy
Public static BlockTestOre;
int BlockTestOreID = 500;
Put this code in @init
ButtonOre = new BlockButtonOre(ButtonOreID, Material.iron).setUnlocalizedName("Button Ore");LanguageRegistry.addName(ButtonOre, "Button Ore");GameRegistry.registerBlock(ButtonOre);
It should look like this in the end.
package mods.Test.Common;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
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.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
//---------------------------------------------------------------------------------------------------------------------------------
//Name of the mod and the version of your mod.
//Client side should stay true. Server side should stay false (If server side is true then only people that have your mod installed can join)
@Mod(modid = "TestMod", name = "Test", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class TestMain {
//---------------------------------------------------------------------------------------------------------------------------------
@Instance("TestMod")
public static TestMain instance;
//---------------------------------------------------------------------------------------------------------------------------------
@SidedProxy(clientSide="mods.Test.Client.ClientProxyTest", serverSide="mods.Test.Common.CommonProxyTest")
public static CommonProxyTest proxy;
public static Block BlockTestOre;
int BlockTestOreID = 500;
//---------------------------------------------------------------------------------------------------------------------------------
@PreInit
@Init
public void init(FMLInitializationEvent event) {
proxy.registerRenderThings();
BlockTestOre = new BlockTestOre(BlockTestOreID, Material.iron).setUnlocalizedName("BlockTest Ore");LanguageRegistry.addName(BlockTestOre, "BlockTest Ore");GameRegistry.registerBlock(BlockTestOre);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@PostInit
public static void postInit(FMLPostInitializationEvent event) {
}
}
2. Items
This will show you how to make items so you can mess with. Items that can be used for many things.
Time to create a new item and the first item we'll be making is a ingot. To add a ingot into the game we'll be needing to make a new texture and a new class but not just that we need to add code in the main class so let get started.
Inside TestMain and add a few code such as listed below.
Put this code in @Sided Proxy
public static Item ItemTestIngot;
int ItemTestIngotID = 501;
Put this code in @init
ItemTestIngot = new ItemTestIngot(ItemTestIngotID).setUnlocalizedName("ItemTest Ingot");LanguageRegistry.addName(ItemTestIngot, "ItemTest Ingot");GameRegistry.registerItem(ItemTestIngot, "Test Ingot");
package mods.Test.Common;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
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.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
//---------------------------------------------------------------------------------------------------------------------------------
//Name of the mod and the version of your mod.
//Client side should stay true. Server side should stay false (If server side is true then only people that have your mod installed can join)
@Mod(modid = "TestMod", name = "Test", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class TestMain {
//---------------------------------------------------------------------------------------------------------------------------------
@Instance("TestMod")
public static TestMain instance;
//---------------------------------------------------------------------------------------------------------------------------------
@SidedProxy(clientSide="mods.Test.Client.ClientProxyTest", serverSide="mods.Test.Common.CommonProxyTest")
public static CommonProxyTest proxy;
public static Block BlockTestOre;
public static Item ItemTestIngot;
int BlockTestOreID = 500;
int ItemTestIngotID = 501;
//---------------------------------------------------------------------------------------------------------------------------------
@PreInit
@Init
public void init(FMLInitializationEvent event) {
proxy.registerRenderThings();
BlockTestOre = new BlockTestOre(BlockTestOreID, Material.iron).setUnlocalizedName("BlockTest Ore");LanguageRegistry.addName(BlockTestOre, "BlockTest Ore");GameRegistry.registerBlock(BlockTestOre);
ItemTestIngot = new ItemTestIngot(ItemTestIngotID).setUnlocalizedName("ItemTest Ingot");LanguageRegistry.addName(ItemTestIngot, "ItemTest Ingot");GameRegistry.registerItem(ItemTestIngot, "Test Ingot");
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@PostInit
public static void postInit(FMLPostInitializationEvent event) {
}
}
The new things you should see added in the main class code.
public static Item ItemTestIngot;
int ItemTestIngotID = 501;
ItemTestIngot = new ItemTestIngot(ItemTestIngotID).setUnlocalizedName("ItemTest Ingot");LanguageRegistry.addName(ItemTestIngot, "ItemTest Ingot");GameRegistry.registerItem(ItemTestIngot, "Test Ingot");
Now we are going need to make a new class. And it is going to be called ItemTestIngot. Note: any Item or block you make you should always put Item or Block in front of the class to keep things organized.
Right click mods.Test.Common and create a new class. And name the class ItemTestIngot. Once you have done that press finish and paste this in there.
package mods.Test.Common;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class ItemTestIngot extends Item{
public ItemTestIngot(int par1) {
super(par1);
this.setCreativeTab(CreativeTabs.tabMaterials);
}
@Override
public void updateIcons(IconRegister iconRegister)
{
iconIndex = iconRegister.registerIcon("Test:itemTest");
}
}
Once you did that you will noticed that the texture was changed. So the location for that texture would be in mods/Test/textures/items/itemTest.png. That is were the texture is going to be placed so you can see the texture.
This is telling you were the item texture is inside the mod.. The first is the mod name. and the second is the png file you have in the mod.
("Test:itemTest");
3. Record Disc
Have you ever wanted to make a new music disc that played sounds. We'll now you can just follow the guide i give you in the below spoiler box.
To create a new record disc is very simple with this guide as long as you follow everything. Make sure you are using the latest forge. Now to make a record disc we will need to add to the TestMain class within our mod. What we'll be adding in the TestMain is this.
public static Item recordTest1;
int recordTest1ID = 502;
recordTest1 = new recordTest(502, "ward").setUnlocalizedName("record test");LanguageRegistry.addName(recordTest1, "record Test");GameRegistry.registerItem(recordTest1, "record Test");
Inside TestMain and add a few code such as listed below.
Put this code in @Sided Proxy
public static Item recordTest1;
int recordTest1ID = 502;
Put this code in @init
recordTest1 = new recordTest(502, "ward").setUnlocalizedName("record test");LanguageRegistry.addName(recordTest1, "record Test");GameRegistry.registerItem(recordTest1, "record Test");
Now TestMain class will look like this
package mods.Test.Common;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemRecord;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
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.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
//---------------------------------------------------------------------------------------------------------------------------------
//Name of the mod and the version of your mod.
//Client side should stay true. Server side should stay false (If server side is true then only people that have your mod installed can join)
@Mod(modid = "TestMod", name = "Test", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class TestMain {
//---------------------------------------------------------------------------------------------------------------------------------
@Instance("TestMod")
public static TestMain instance;
//---------------------------------------------------------------------------------------------------------------------------------
@SidedProxy(clientSide="mods.Test.Client.ClientProxyTest", serverSide="mods.Test.Common.CommonProxyTest")
public static CommonProxyTest proxy;
public static Block BlockTestOre;
public static Item ItemTestIngot;
public static Item recordTest1;
int BlockTestOreID = 500;
int ItemTestIngotID = 501;
int recordTest1ID = 502;
//---------------------------------------------------------------------------------------------------------------------------------
@PreInit
@Init
public void init(FMLInitializationEvent event) {
proxy.registerRenderThings();
BlockTestOre = new BlockTestOre(BlockTestOreID, Material.iron).setUnlocalizedName("BlockTest Ore");LanguageRegistry.addName(BlockTestOre, "BlockTest Ore");GameRegistry.registerBlock(BlockTestOre);
ItemTestIngot = new ItemTestIngot(ItemTestIngotID).setUnlocalizedName("ItemTest Ingot");LanguageRegistry.addName(ItemTestIngot, "ItemTest Ingot");GameRegistry.registerItem(ItemTestIngot, "Test Ingot");
recordTest1 = new recordTest(502, "ward").setUnlocalizedName("record test");LanguageRegistry.addName(recordTest1, "record Test");GameRegistry.registerItem(recordTest1, "record Test");
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@PostInit
public static void postInit(FMLPostInitializationEvent event) {
}
}
Once you have that done your going want to make a new class file and call that class file recordTest. Once you have done that copy and paste this in there.
package mods.Test.Common;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockJukeBox;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
public class recordTest extends ItemRecord{
/** List of all record items and their names. */
private static final Map records = new HashMap();
/** The name of the record. */
public final String recordName;
protected recordTest(int par1, String par2Str)
{
super(par1, par2Str);
this.recordName = par2Str;
this.maxStackSize = 1;
this.setCreativeTab(CreativeTabs.tabMisc);
records.put(par2Str, this);
}
@SideOnly(Side.CLIENT)
/**
* Gets an icon index based on an item's damage value
*/
public Icon getIconFromDamage(int par1)
{
return this.iconIndex;
}
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par3World.getBlockId(par4, par5, par6) == Block.jukebox.blockID && par3World.getBlockMetadata(par4, par5, par6) == 0)
{
if (par3World.isRemote)
{
return true;
}
else
{
((BlockJukeBox)Block.jukebox).insertRecord(par3World, par4, par5, par6, par1ItemStack);
par3World.playAuxSFXAtEntity((EntityPlayer)null, 1005, par4, par5, par6, this.itemID);
--par1ItemStack.stackSize;
return true;
}
}
else
{
return false;
}
}
@SideOnly(Side.CLIENT)
/**
* allows items to add custom lines of information to the mouseover description
*/
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add(this.getRecordTitle());
}
@SideOnly(Side.CLIENT)
/**
* Return the title for this record.
*/
public String getRecordTitle()
{
return "SongTest - " + this.recordName;
}
@SideOnly(Side.CLIENT)
/**
* Return an item rarity from EnumRarity
*/
public EnumRarity getRarity(ItemStack par1ItemStack)
{
return EnumRarity.rare;
}
@SideOnly(Side.CLIENT)
/**
* Return the record item corresponding to the given name.
*/
public static ItemRecord getRecord(String par0Str)
{
return (ItemRecord)records.get(par0Str);
}
@SideOnly(Side.CLIENT)
@Override
public void updateIcons(IconRegister iconRegister)
{
iconIndex = iconRegister.registerIcon("Test:itemRecordTest1");
}
}
If you want to change the record title name this is the code you want to use.
/**
* Return the title for this record.
*/
public String getRecordTitle()
{
return "SongTest - " + this.recordName;
}
How to change the disc music/ sound play through once used on a jute box.
First of all this code is what going be playing the sound/ music you want.
recordTest1 = new recordTest(502, "ward").setUnlocalizedName("record test");LanguageRegistry.addName(recordTest1, "record Test");GameRegistry.registerItem(recordTest1, "record Test");
To change the music disc sound / music were it says "ward" you are going to change it to "test". once you have changed it to "test" it will play test.obj file once you have made that .obj music /sound file. Now if you are going be making a new sound in real life I use Audacity and to make that sound a .onj you need to record it and then export to .ogg. If you wanna take .wmv and convert I usually use sony vegas pro.
FORGE MCP TESTING: Now once you have your test.obj you are going want to place it into this. NOTE: You can not reobuscate a .obj or a png. You must manually add them into your mod. C:\Users\username\Desktop\forge\mcp\jars\resources\mod\streaming
CLIENT MINECRAFT: Now once you have your test.obj you are going to place in your .minecraft folder area
C:\Users\username\AppData\Roaming\.minecraft\resources\mod\streaming
If you still dont understand I'll try explaining better. All it is, is simply adding the .obj into the area were it is playable. so minecraft client you add in the rescorces\mods\streaming.
And for the mcp you add in forge\mcp\jars\rescorces\mod\streaming.
How to place the source in your eclipse to start modding. First you need to download the source and when you did that you need to open your forge folder that you are using to make the mods. So example C:\Users\username\Desktop\forge\mcp\src\minecraft Once you found it go to the downloaded source and right click it and extract here. You will need winrar or 7zip to do this.
To add forge mods on a vanilla server is simple all you need to do is follow these steps.
1. Download minecraft_server.jar from the minecraft main website.
2. Download the forge universe latest build, You can find at the top of this page.
3. Make a server folder and place minecraft_server.jar in there.
4. You need winrar or 7zip for this part: right click minecraft_server.jar and open with winrar.
5. Go to forge universe and open it. Drag everything you see in there into the minecraft_server.jar archive/ winrar.
6. Close the archives/ winrar that are open and run the minecraft_server.jar
7. Once the server fully loaded you are going need to close it and change your ip to your default gateway. You need to port forward your minecraft.
8. Were it now says mods you are going drag and drop the .zip mods in there.
NOTE: You must have forge installed in your minecraft client.
NOTE: Have the same mods on the server added into your .minecraft/mods
More coming and if you need help with the code post in the comments.
You should make a forge tutorial for a mod that includes making a mod because i wanted to make a mod with hawks that you can tame and have hunt for you and keep as pets
This was all using forge build 602 and MCP v744. The latest forge build is 608 so it might have changed some? Or are you using outdated mcp or forge?
Don't worry I figured it out... just had to change "public void registerIcons" to "public void func_94332_a" i am using the latest updated stuff but it seems like forge hasnt given a name to the methods yet. Or maybe i just confused links but it's fixed now
Don't worry I figured it out... just had to change "public void registerIcons" to "public void func_94332_a" i am using the latest updated stuff but it seems like forge hasnt given a name to the methods yet. Or maybe i just confused links but it's fixed now
The ones who are fixing the naming and that kind of stuff is actually the mcp so you might not have the latest version of mcp?
I can't figure out what I'm doing wrong with adding my mod to my client. I copied the text you had exactly and I just copied the proxies didn't add the blocks or textures. Went to my mcp744, recompiled, and reobfuscated. Went to the reobf > minecraft > mods folder copied the folders in there, and pasted them in my freshly installed Minecraft Forge 1.5.1 client. I get this error every time :
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Failed to start game
A full error report has been saved to C:\Users\Tyler\AppData\Roaming\.minecraft\crash-reports\crash-2013-03-25_23.44.32-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash
--- BEGIN ERROR REPORT 3a590c2e --------
Full report at:
C:\Users\Tyler\AppData\Roaming\.minecraft\crash-reports\crash-2013-03-25_23.44.32-client.txt
Please show that file to Mojang, NOT just this screen!
Generated 3/25/13 11:44 PM
-- System Details --
Details:
Minecraft Version: 1.5.1
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_17, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 434111728 bytes (414 MB) / 648740864 bytes (618 MB) up to 954466304 bytes (910 MB)
JVM Flags: 2 total; -Xms512m -Xmx1024m
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.44 FML v5.1.8.608 Minecraft Forge 7.7.0.608 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML [Forge Mod Loader] (coremods) Unloaded->Constructed
Forge [Minecraft Forge] (coremods) Unloaded->Constructed
TestMod [Test] (blocks) Unloaded->Errored
LWJGL: 2.4.2
OpenGL: GeForce GT 640/PCIe/SSE2 GL version 4.2.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'forge,fml'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: mods.blocks.Common.TestMain
at cpw.mods.fml.common.LoadController.transition(LoadController.java:142)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:512)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:160)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:407)
at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56)
at net.minecraft.client.Minecraft.run(Minecraft.java:729)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: mods.blocks.Common.TestMain
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:211)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:56)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:446)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:502)
... 5 more
Caused by: java.lang.NullPointerException
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:200)
... 32 more
--- END ERROR REPORT 76fcef2a ----------
I can't figure out what I'm doing wrong with adding my mod to my client. I copied the text you had exactly and I just copied the proxies didn't add the blocks or textures. Went to my mcp744, recompiled, and reobfuscated. Went to the reobf > minecraft > mods folder copied the folders in there, and pasted them in my freshly installed Minecraft Forge 1.5.1 client. I get this error every time :
[CODE]
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; Failed to start game
A full error report has been saved to C:\Users\Tyler\AppData\Roaming\.minecraft\crash-reports\crash-2013-03-25_23.44.32-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash
--- BEGIN ERROR REPORT 3a590c2e --------
Full report at:
C:\Users\Tyler\AppData\Roaming\.minecraft\crash-reports\crash-2013-03-25_23.44.32-client.txt
Please show that file to Mojang, NOT just this screen!
Generated 3/25/13 11:44 PM
-- System Details --
Details:
Minecraft Version: 1.5.1
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_17, Oracle Corporation
Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 434111728 bytes (414 MB) / 648740864 bytes (618 MB) up to 954466304 bytes (910 MB)
JVM Flags: 2 total; -Xms512m -Xmx1024m
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.44 FML v5.1.8.608 Minecraft Forge 7.7.0.608 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML [Forge Mod Loader] (coremods) Unloaded->Constructed
Forge [Minecraft Forge] (coremods) Unloaded->Constructed
TestMod [Test] (blocks) Unloaded->Errored
LWJGL: 2.4.2
OpenGL: GeForce GT 640/PCIe/SSE2 GL version 4.2.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'forge,fml'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: mods.blocks.Common.TestMain
at cpw.mods.fml.common.LoadController.transition(LoadController.java:142)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:512)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:160)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:407)
at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56)
at net.minecraft.client.Minecraft.run(Minecraft.java:729)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: mods.blocks.Common.TestMain
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:211)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:56)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:446)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:502)
... 5 more
Caused by: java.lang.NullPointerException
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:200)
... 32 more
--- END ERROR REPORT 76fcef2a ----------
To find the solution when ever a crash is made you will need to look for something similar to this if you din't make a class for it or din't name the class file correctly you will get a crash and then you will need to look at the crash to see what happen.
But what you really need to find is this because it tells you what your missing. But sometime in a crash it wont tell you what your missing and will give you a code number to your mod that will take you to your problem to fix.
So I want you to look for the crash and find this. It will teach you were your crash has happen. The thing I gave listed above is showing that you dint make a class file for that object or din't name the class file for blocks right. Try rechecking the mod capitalize words because everything matters. Still need help send your code in a spoiler / code.
To do that make sure it looks like this.
spolier
Any thing you want to add as a message here
code
[Copy paste your code here]
code/
spolier/
Note: it wont look exactly like that because it needs special stuff to show.
If you have a look at SCMowns' tutorial page. It's really well set out and has videos and stuff.
ModLoader and Forge is completely different and here is a example of what I mean.
Modloader: Will not support server mods and only client mods for single player.
Forge: Supports server capability and also client for multiplayer and single player. If any modloader code is in the forge mod it will not work for server.
You should make a forge tutorial for a mod that includes making a mod because i wanted to make a mod with hawks that you can tame and have hunt for you and keep as pets
I have a mod in the banner called Advanced mod but have not had time to fully update it because of a few things I been adding. Such as expansions to the mod. Also been working on a new mod but has not yet been posted on the forum.
Note: If you are posting a forum or video tutorial from this tutorial forum leave credit to me by posting the link to this forum and the name of the maker of this forum please do not steal my work even with the source file that is release.
This is forge modding tutorials for you to experiment with and use. I'll be showing you how to make basic to advanced mods.
Things needed:
Forge universe and source
and
Eclipse to make things more easy
To setup forge into eclipse you must first download the source and extract. Once extracted go into the folder and install.Then open eclipse and go to file - switch workspace and find the folder you just installed witch be forge/mcp/eclipse and then open but it wont exactly say forge/mcp/eclipse it will have your computer name and were ever the folder is located like this C:\Users\ComputerName\Desktop\Forge Test Tutorial\forge\mcp\eclipse.
Now since we have eclipse and forge ready we can begin modding our minecraft to make mods.
Step 1.
To create your mod you need to create a new package. On the left there will be a minecraft folder. Click the + sign next to the miencraft folder and it will extend down with other folders. Now you will see a folder called src do the same thing click the + sign. Once it fully extends down you can begin. Right click src and and hover your mouse over new and and go to were it says Package. The package is going be the name of your mod but since 1.5. came out you will need to name your package mods.YourModNameMain. All lower cases for mods and then put a period and then your mod name.
Now you will need to make a few more packages to get started. Just do the same thing you did with mods.YourModNameMain. Or just copy and paste these when you selected a new package to create. Press Ctrl + C to copy. And press Ctrl + V to paste.
mods.YourModName.Common
mods.YoutModName.Client
mods.YourModName.textures.blocks
mods.YourModName.textures.items
Step 2.
To make a class right click the package you want the class file to be in and select new - class and then name it what you want YourModName. And if you don't know what a class file is we'll it is simply the code of your mod.
First we are going make a new class in this package mods.YourModName.Client to get this out of the way and to do so you are going need to right click mods.YourModName.Client and create a new class and call the class file ClientProxyTest Once that is done you are going want to copy and paste this code into your class file.
Next we are going make a class in this package mods.YourModName.Common to do so just do the same thing you did with the other class. Now copy and paste this code once you have your class made.
Now we are going to make the main class for your mod. This class will have many things just think of it as your base mod. Create a new class in mods.YourModName.Common and call the class TestMain and hit finish. Once you have your main class for your mod you are going to copy this code and paste into your class.
Now since we have the basic stuff that is needed to get started we can now start making mods and from here on out every class we make will be going into the mods.Test.Common package area unless later on I say we are going change it. And add something into a different package.
1. Blocks
The blocks you see in minecraft but this will show you how to make your own blocks in minecraft.
Make a new class in mods.Test.Common and call it TestBlockOre then press finish. Once you have done so you are going copy this code and paste it into your test block
NOTE! If you so happen to be usuing the 1.5.1 forge build then this texture is not advise to use as it will give error. But if you are usuing 1.5 then this texture is correct for usage.
For the 1.5.1 texture replace this code
The first Test is the package of the mod. The second is the png file name for your texture.
Now you are going want to go back to your Main base mod. TestMain and add a few code such as listed below.
Put this code in @Sided Proxy
Put this code in @init
It should look like this in the end.
2. Items
This will show you how to make items so you can mess with. Items that can be used for many things.
Time to create a new item and the first item we'll be making is a ingot. To add a ingot into the game we'll be needing to make a new texture and a new class but not just that we need to add code in the main class so let get started.
Inside TestMain and add a few code such as listed below.
Put this code in @Sided Proxy
Put this code in @init
The new things you should see added in the main class code.
Now we are going need to make a new class. And it is going to be called ItemTestIngot. Note: any Item or block you make you should always put Item or Block in front of the class to keep things organized.
Right click mods.Test.Common and create a new class. And name the class ItemTestIngot. Once you have done that press finish and paste this in there.
Once you did that you will noticed that the texture was changed. So the location for that texture would be in mods/Test/textures/items/itemTest.png. That is were the texture is going to be placed so you can see the texture.
This is telling you were the item texture is inside the mod.. The first is the mod name. and the second is the png file you have in the mod.
("Test:itemTest");
3. Record Disc
Have you ever wanted to make a new music disc that played sounds. We'll now you can just follow the guide i give you in the below spoiler box.
To create a new record disc is very simple with this guide as long as you follow everything. Make sure you are using the latest forge. Now to make a record disc we will need to add to the TestMain class within our mod. What we'll be adding in the TestMain is this.
Inside TestMain and add a few code such as listed below.
Put this code in @Sided Proxy
Put this code in @init
Now TestMain class will look like this
Once you have that done your going want to make a new class file and call that class file recordTest. Once you have done that copy and paste this in there.
If you want to change the record title name this is the code you want to use.
How to change the disc music/ sound play through once used on a jute box.
First of all this code is what going be playing the sound/ music you want.
To change the music disc sound / music were it says "ward" you are going to change it to "test". once you have changed it to "test" it will play test.obj file once you have made that .obj music /sound file. Now if you are going be making a new sound in real life I use Audacity and to make that sound a .onj you need to record it and then export to .ogg. If you wanna take .wmv and convert I usually use sony vegas pro.
FORGE MCP TESTING: Now once you have your test.obj you are going want to place it into this. NOTE: You can not reobuscate a .obj or a png. You must manually add them into your mod. C:\Users\username\Desktop\forge\mcp\jars\resources\mod\streaming
CLIENT MINECRAFT: Now once you have your test.obj you are going to place in your .minecraft folder area
C:\Users\username\AppData\Roaming\.minecraft\resources\mod\streaming
If you still dont understand I'll try explaining better. All it is, is simply adding the .obj into the area were it is playable. so minecraft client you add in the rescorces\mods\streaming.
And for the mcp you add in forge\mcp\jars\rescorces\mod\streaming.
How to place the source in your eclipse to start modding. First you need to download the source and when you did that you need to open your forge folder that you are using to make the mods. So example C:\Users\username\Desktop\forge\mcp\src\minecraft Once you found it go to the downloaded source and right click it and extract here. You will need winrar or 7zip to do this.
Source download:
V1.5.1 - 3/26/13
Adding mods on a Vanilla Server
To add forge mods on a vanilla server is simple all you need to do is follow these steps.
1. Download minecraft_server.jar from the minecraft main website.
2. Download the forge universe latest build, You can find at the top of this page.
3. Make a server folder and place minecraft_server.jar in there.
4. You need winrar or 7zip for this part: right click minecraft_server.jar and open with winrar.
5. Go to forge universe and open it. Drag everything you see in there into the minecraft_server.jar archive/ winrar.
6. Close the archives/ winrar that are open and run the minecraft_server.jar
7. Once the server fully loaded you are going need to close it and change your ip to your default gateway. You need to port forward your minecraft.
8. Were it now says mods you are going drag and drop the .zip mods in there.
NOTE: You must have forge installed in your minecraft client.
NOTE: Have the same mods on the server added into your .minecraft/mods
More coming and if you need help with the code post in the comments.
Visit my youtube channel? http://www.youtube.com/user/TheCoolgatty
You could check out my tutorial on items, I made it so that you can use one class for all your items and still give them different textures.
Here is the link: http://www.minecraftforum.net/topic/1625686-15wip-xetos-forge-modding-tutorials-updated-24032013-done-blocks-and-items/
I'll check it out and see if it works
EDIT:
"this.blockIcon" and ".registerIcon" both give me errors.
I am using the latest forge version
I replaced them with
but it didn't work either. I did put the textures in the right path.
Visit my youtube channel? http://www.youtube.com/user/TheCoolgatty
This was all using forge build 602 and MCP v744. The latest forge build is 608 so it might have changed some? Or are you using outdated mcp or forge?
EDIT:
I got the latest forge build 608 and it still works.
Don't worry I figured it out... just had to change "public void registerIcons" to "public void func_94332_a" i am using the latest updated stuff but it seems like forge hasnt given a name to the methods yet. Or maybe i just confused links but it's fixed now
Visit my youtube channel? http://www.youtube.com/user/TheCoolgatty
The ones who are fixing the naming and that kind of stuff is actually the mcp so you might not have the latest version of mcp?
Nah I'm using mcp744 for minecraft 1.5.1
Visit my youtube channel? http://www.youtube.com/user/TheCoolgatty
To find the solution when ever a crash is made you will need to look for something similar to this if you din't make a class for it or din't name the class file correctly you will get a crash and then you will need to look at the crash to see what happen.
But what you really need to find is this because it tells you what your missing. But sometime in a crash it wont tell you what your missing and will give you a code number to your mod that will take you to your problem to fix.
So I want you to look for the crash and find this. It will teach you were your crash has happen. The thing I gave listed above is showing that you dint make a class file for that object or din't name the class file for blocks right. Try rechecking the mod capitalize words because everything matters. Still need help send your code in a spoiler / code.
To do that make sure it looks like this.
Any thing you want to add as a message here
code
[Copy paste your code here]
code/
spolier/
Note: it wont look exactly like that because it needs special stuff to show.
ModLoader and Forge is completely different and here is a example of what I mean.
Modloader: Will not support server mods and only client mods for single player.
Forge: Supports server capability and also client for multiplayer and single player. If any modloader code is in the forge mod it will not work for server.
Those stuff are on there way. :3
I have a mod in the banner called Advanced mod but have not had time to fully update it because of a few things I been adding. Such as expansions to the mod. Also been working on a new mod but has not yet been posted on the forum.
Tutorial for that is coming soon
Thank you! ;D
The item texture is now available