So right, me being this new original kind of guy decided I would teach modding and java a little bit different then everyone else. Most people bore you with boring tutorials that have nothing to do with each other. I just can't do that. Boring is boring right? So together you and I and everyone else will create a mod. That 's my ingenious idea! That's it! Don't you get it? What better way to teach modding then by creating a mod. Instead of tutorials that have nothing to do with each other, here, each tutorial will build on each other until we have an actual mod. In that way you will learn what it actually takes to build a mod. I hope you enjoy.
Contents:
1. A little bit about the mod
2. Tutorials with source code and in depth explanation (Optional Videos)
3. How to contact me, mrsal511
List of tutorials:
1. The set-up of files and programs - Uploaded
2. How to create a Block - Uploaded
3. Making a crafting recipe for that block - Uploaded
4. Making that block naturally generate - Edited
5. Making that block more rare - Edited
6. Creating the Ingot for that block - Filmed
7. Creating a smelting recipe for that ingot - Filmed
List of planned tutorials (Subject to Change)
1. Creating Trees with ores
2. Creating a new type of grass or rock
3. Creating a new dimly lit torch
4. Creating new sets of tools and armour
5. Creating new materials
6. Generation (Will take quite a few tutorials)
7. New Furnaces
8. New crafting bench
9. Adding fuel's to furnaces
10. Etc etc etc.
A little bit about the mod:
Imagine a creepy little underground world where the witches hide! It's an evil lair like you have never imagined before. All sorts of weird brewing materials and food.
Enchantments to die for! All sorts of things never seen to man before! Is this possible? Is it really? YES, in the WitchesHome mod it is. THIS is what you will be creating by
following my tutorials! It won't seem like it at first, but once we get going it will be sweet. I hope you enjoy: WitchesHome!
Tutorials:
1. The set-up of Files and programs:
2. How to Create a Block
Source Code:
mod_#### where #### = the name of your mod
package net.minecraft.src;
public class mod_WitchesHome extends BaseMod {
public static final Block fuelOre = new BlockFuelOre(150,0).setHardness(15.0F).setResistance(1000.0F).setBlockName("fuelOre");
public mod_WitchesHome()
{
ModLoader.registerBlock(fuelOre);
fuelOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod/block/fuelOreBlock.png");
ModLoader.addName(fuelOre, "Solidified Oil");
}
public String getVersion(){
return "Witches Home V0.01";
}
public void load(){
}
}
Block#### where #### = the name of your Block
package net.minecraft.src;
import java.util.Random;
public class BlockFuelOre extends Block
{
protected BlockFuelOre(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int i, Random random)
{
return mod_WitchesHome.fuelOre.blockID;
}
}
3. How to make a crafting recipe for that block
Source Code:
mod_#### where #### = the name of your mod
package net.minecraft.src;
public class mod_WitchesHome extends BaseMod {
public static final Block fuelOre = new BlockFuelOre(150,0).setHardness(15.0F).setResistance(1000.0F).setBlockName("fuelOre");
public mod_WitchesHome()
{
ModLoader.registerBlock(fuelOre);
fuelOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod/block/fuelOreBlock.png");
ModLoader.addName(fuelOre, "Solidified Oil");
ModLoader.addRecipe(new ItemStack(fuelOre, 1), new Object[] {
"XX","XX", Character.valueOf('X'), Block.dirt
});
}
public String getVersion(){
return "Witches Home V0.01";
}
public void load(){
}
}
4. Naturally Generating Ore and Blocks
Source Code:
mod_#### where #### = the name of your mod
package net.minecraft.src;
public class mod_WitchesHome extends BaseMod {
public static final Block fuelOre = new BlockFuelOre(150,0).setHardness(15.0F).setResistance(1000.0F).setBlockName("fuelOre");
public mod_WitchesHome()
{
ModLoader.registerBlock(fuelOre);
fuelOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mod/block/fuelOreBlock.png");
ModLoader.addName(fuelOre, "Solidified Oil");
ModLoader.addRecipe(new ItemStack(fuelOre, 1), new Object[] {
"XX","XX", Character.valueOf('X'), Block.dirt
});
}
public void generateSurface(World world, Random rand, int chunkx, int chunkz)
{
for(int l = 0; l < 2; l++)
{
int i1 = chunkx + rand.nextInt(16);
int j1 = rand.nextInt(25);
int k1 = chunkz + rand.nextInt(16);
int Choose = rand.nextInt(4);
if(Choose == 1)
{
(new WorldGenMinable(fuelOre.blockID, 5)).generate(world, rand, i1, j1, k1);
}
}
}
public String getVersion(){
return "Witches Home V0.01";
}
public void load(){
}
}
Let me explain what this does:
public void generateSurface(World world, Random rand, int chunkx, int chunkz)
{
for(int l = 0; l < 2; l++)
{
int i1 = chunkx + rand.nextInt(16);
int j1 = rand.nextInt(25);
int k1 = chunkz + rand.nextInt(16);
(new WorldGenMinable(fuelOre.blockID, 5)).generate(world, rand, i1, j1, k1);
}
}
The first line is basicly what we are calling. Everything inside is setting the parameters and then the last line is what actually does the generating
Love your tutorials and learned much from them and finally they get updatet
(discovered today had a little programmingcrisis; lost like 60% of the code)
thats the mod im making with your knowledge and it looks awesome so far: haha
I absolutly love your tutorials, but when i try to run minecraft off of eclipse, I get an error.
---- Minecraft Crash Report ----
// Why did you do that?
Time: 1/4/13 8:51 AM
Description: Exception occured in ModLoader
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character
at net.minecraft.src.CraftingManager.func_92103_a(CraftingManager.java:168)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:524)
at net.minecraft.src.mod_Starter.<init>(mod_Starter.java:13)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:395)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1406)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:190)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:93)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:421)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_09, Oracle Corporation
Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 994594344 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, MinecraftFakeLauncher, ThreadShutdown, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 1
ModLoader 1.4.6
I have no idea what this means. PLZ HELP!
Rollback Post to RevisionRollBack
I reject your reality and substitute my own. Adam Savage, Mythbuster.
I absolutly love your tutorials, but when i try to run minecraft off of eclipse, I get an error.
---- Minecraft Crash Report ----
// Why did you do that?
Time: 1/4/13 8:51 AM
Description: Exception occured in ModLoader
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character
at net.minecraft.src.CraftingManager.func_92103_a(CraftingManager.java:168)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:524)
at net.minecraft.src.mod_Starter.<init>(mod_Starter.java:13)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:395)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1406)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:190)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:93)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:421)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_09, Oracle Corporation
Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 994594344 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, MinecraftFakeLauncher, ThreadShutdown, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 1
ModLoader 1.4.6
I have no idea what this means. PLZ HELP!
look on the noted classes(net.minecraft.src. ...) if you havent chanched the craftingmanager it is most likely in your modfile, line 13 like notet
at net.minecraft.src.mod_Starter.<init>(mod_Starter.java:13)
What the heck? I am new to modding, can you please explain in English?
ModLoader.addRecipe(new ItemStack(RainBow, 3), new Object[] {
that is my line 13, if that will help.
sorry hadnt thought of it
but first some knowledge:
to fix a mistake in the code you have to locate it(what i did):
the crash log shows the classes and the errors shouldnt be in default classes like them from modloader ore vanilla minecraft so you look through the crashlog for your class(mod_Starter.java) the number after it is the line in the code(13)
sorry if you knew this already
here my problem the initialization of the problem is in line 13(the 'ModLoader.addReciepe) but thats not wrong
so either you forgot the recipe(which i doubt) or the actual error in the rest of the recipe
This is the recipie. I did not know how to do the dyes, so i think that might be it
1. just for more space you can delete the 'Character.valueOf':
"AB","BA", 'A', Item.dyePowder,"green", 'B', Item.dyePowder, "red"
but that is not necesairy
2. you have to give the colors in their data values (cactusgree=2) (rosered =1)
and if you have an Item with a datavalue you have to put 'new ItemStack(yourItem,1 ,its dataValue)' in.
but i dont know what the first one is for
if you want different colors just google it or look it up on the wiki
and this should work
"AB","BA", 'A', new ItemStack(IItem.dyePowder,1, 2), 'B', new ItemStack(IItem.dyePowder,1, 1)
So i did that tried to run it. Now it says "Error occurred during initialization to VM. Could not reserve enough space for object heap."
My brain just exploded.
Rollback Post to RevisionRollBack
I reject your reality and substitute my own. Adam Savage, Mythbuster.
So i did that tried to run it. Now it says "Error occurred during initialization to VM. Could not reserve enough space for object heap."
My brain just exploded.
I tried to run it again. I had found a couple of errors, so i fixed those.I got this crash report.
---- Minecraft Crash Report ----
// Ooh. Shiny.
Time: 1/5/13 8:01 AM
Description: Unexpected error
java.lang.RuntimeException: java.lang.Exception: Image not found: /mod/block/Rainbowblock.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1694)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1200)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:878)
at net.minecraft.client.Minecraft.run(Minecraft.java:768)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /mod/block/Rainbowblock.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1117)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1686)
... 5 more
But i could not find any of my classes!!
I see at the top it says "Image not found" That was probably itWhere do i put my block texture file?
Rollback Post to RevisionRollBack
I reject your reality and substitute my own. Adam Savage, Mythbuster.
Contents:
1. A little bit about the mod
2. Tutorials with source code and in depth explanation (Optional Videos)
3. How to contact me, mrsal511
List of tutorials:
1. The set-up of files and programs - Uploaded
2. How to create a Block - Uploaded
3. Making a crafting recipe for that block - Uploaded
4. Making that block naturally generate - Edited
5. Making that block more rare - Edited
6. Creating the Ingot for that block - Filmed
7. Creating a smelting recipe for that ingot - Filmed
List of planned tutorials (Subject to Change)
1. Creating Trees with ores
2. Creating a new type of grass or rock
3. Creating a new dimly lit torch
4. Creating new sets of tools and armour
5. Creating new materials
6. Generation (Will take quite a few tutorials)
7. New Furnaces
8. New crafting bench
9. Adding fuel's to furnaces
10. Etc etc etc.
A little bit about the mod:
Imagine a creepy little underground world where the witches hide! It's an evil lair like you have never imagined before. All sorts of weird brewing materials and food.
Enchantments to die for! All sorts of things never seen to man before! Is this possible? Is it really? YES, in the WitchesHome mod it is. THIS is what you will be creating by
following my tutorials! It won't seem like it at first, but once we get going it will be sweet. I hope you enjoy: WitchesHome!
Tutorials:
1. The set-up of Files and programs:
2. How to Create a Block
Source Code:
mod_#### where #### = the name of your mod
Block#### where #### = the name of your Block
3. How to make a crafting recipe for that block
Source Code:
mod_#### where #### = the name of your mod
4. Naturally Generating Ore and Blocks
Source Code:
mod_#### where #### = the name of your mod
Let me explain what this does:
The first line is basicly what we are calling. Everything inside is setting the parameters and then the last line is what actually does the generating
That guy that makes the wheels turn.. Y'know...
I am going to make a modificilaimationes, and this is the best tutorial I haz seen so far.
Thanks!
Thanks! I hope you enjoy the mod as it progresses!
That guy that makes the wheels turn.. Y'know...
Sorry that Curse messed up my post. It was not my fault.
That guy that makes the wheels turn.. Y'know...
my decompile.bat says this following
== 7.23 <Data: 7.23, client: 1.4.5, server: 1.4.5> ==
Searching fo javac.exe in C:/ProgramFiles
# found ff, ff patches, srgs,name csvs, doc csvs, param csvs, renumber csv, ast
yle, astly config
!! Updates availible. Please run updatemcp to get them. !!
Creating Retroguard config files
!! Modified jar detected. Unpredictable results !!
== Decompiling client using fernflower ==
Creating SRGs
Applying Retroguard
'"C:\Program files\jdk1.6.0_35\bin\java" -cp "runtime\bin\reroguard.jar;li
b;lib\*;jars\bin\mine...' failed : 1
== ERRORS FOUND ==
Unrecoverable error during obfuscation, see log file for details.
Retroguard error: COM.rl.obf.classfile.ClassFileExeption: ClassNotFound com/goo
gle/common/base/Supplier
============
Decompile failed
Press any key to continue . . .
if anyone can help please do!
ignore this
(discovered today had a little programmingcrisis; lost like 60% of the code)
thats the mod im making with your knowledge and it looks awesome so far: haha
http://www.minecraftforum.net/topic/1590731-the-mesavic-mod/#entry19526216
---- Minecraft Crash Report ----
// Why did you do that?
Time: 1/4/13 8:51 AM
Description: Exception occured in ModLoader
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character
at net.minecraft.src.CraftingManager.func_92103_a(CraftingManager.java:168)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:524)
at net.minecraft.src.mod_Starter.<init>(mod_Starter.java:13)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:395)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1406)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:190)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:93)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:421)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_09, Oracle Corporation
Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 994594344 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, MinecraftFakeLauncher, ThreadShutdown, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 1
ModLoader 1.4.6
I have no idea what this means. PLZ HELP!
look on the noted classes(net.minecraft.src. ...) if you havent chanched the craftingmanager it is most likely in your modfile, line 13 like notet
at net.minecraft.src.mod_Starter.<init>(mod_Starter.java:13)
What the heck? I am new to modding, can you please explain in English?
ModLoader.addRecipe(new ItemStack(RainBow, 3), new Object[] {
that is my line 13, if that will help.
sorry hadnt thought of it
but first some knowledge:
to fix a mistake in the code you have to locate it(what i did):
the crash log shows the classes and the errors shouldnt be in default classes like them from modloader ore vanilla minecraft so you look through the crashlog for your class(mod_Starter.java) the number after it is the line in the code(13)
sorry if you knew this already
here my problem the initialization of the problem is in line 13(the 'ModLoader.addReciepe) but thats not wrong
so either you forgot the recipe(which i doubt) or the actual error in the rest of the recipe
send me the rest of this and i will help you
This is the recipie. I did not know how to do the dyes, so i think that might be it
1. just for more space you can delete the 'Character.valueOf':
"AB","BA", 'A', Item.dyePowder,"green", 'B', Item.dyePowder, "red"
but that is not necesairy
2. you have to give the colors in their data values (cactusgree=2) (rosered =1)
and if you have an Item with a datavalue you have to put 'new ItemStack(yourItem,1 ,its dataValue)' in.
but i dont know what the first one is for
if you want different colors just google it or look it up on the wiki
and this should work
"AB","BA", 'A', new ItemStack(IItem.dyePowder,1, 2), 'B', new ItemStack(IItem.dyePowder,1, 1)
My brain just exploded.
sry no idea
I tried to run it again. I had found a couple of errors, so i fixed those.I got this crash report.
---- Minecraft Crash Report ----
// Ooh. Shiny.
Time: 1/5/13 8:01 AM
Description: Unexpected error
java.lang.RuntimeException: java.lang.Exception: Image not found: /mod/block/Rainbowblock.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1694)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1200)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:878)
at net.minecraft.client.Minecraft.run(Minecraft.java:768)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /mod/block/Rainbowblock.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1117)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1686)
... 5 more
But i could not find any of my classes!!I see at the top it says "Image not found" That was probably itWhere do i put my block texture file?