Hello!
I have made a mod where a new block is added to Minecraft. I eventually plan on making it into a new ore, but right now, it is just a block. After typing up the code in java (which I'm a beginner at), I recompiled it and reobfuscated it. Then, I put the two .class files into my %appdata%\Roaming\.minecraft\bin\minecraft.jar(which I opened with WinRAR) and installed those files like I would with any mod AND I installed ModLoader. I also put the texture file (in png format) into the minecraft.jar so that it could know what my block looks like.
Unfortunately, when I run Minecraft, everything goes normally until right after the Mojang logo. It says, "Minecraft has encountered a problem!" and then this:
Mods loaded: 1
ModLoader 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 9f578458 --------
Generated 4/12/12 3:42 PM
Minecraft: Minecraft 1.2.5
OS: Windows NT (unknown) (amd64) version 6.2
Java: 1.7.0_03, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: AMD Radeon HD 6310 Graphics version 4.1.10834 Compatibility Profile Context, ATI Technologies Inc.
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT b6002717 ----------
I don't know what any of this means.
If anyone knows what this means, please explain! Also, please tell me how to fix it!
package net.minecraft.src;
import java.util.Random;
public class BlockIdkium extends Block
{
public BlockIdkium(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random)
{
return 1;
}
}
mod_Idkium.java:
package net.minecraft.src;
public abstract class mod_Idkium extends BaseMod
{
public mod_Idkium()
{
ModLoader.registerBlock(idkium);
ModLoader.addName(idkium, "Idkium Ore");
}
public static Block idkium;
static
{
idkium = (new BlockIdkium(123, ModLoader.addOverride("/terrain.png", "/Awesome/Blocks/idkium.png"))).setHardness(3.5F).setResistance(5.0F).setBlockName("idkium");
}
public String Version()
{
return "Idkium v1.2.5_01";
}
}
Your mod_ class cannot be abstract. Remove the abstract and change
public mod_Idkium()
to
public void load()
and
public String Version()
to
public String getVersion()
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
When I ran minecraft, It got to the Mojang logo, then crashed, saying:
Mods loaded: 1
ModLoader 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 9f578458 --------
Generated 4/12/12 6:08 PM
Minecraft: Minecraft 1.2.5
OS: Windows NT (unknown) (amd64) version 6.2
Java: 1.7.0_03, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: AMD Radeon HD 6310 Graphics version 4.1.10834 Compatibility Profile Context, ATI Technologies Inc.
java.lang.RuntimeException: java.lang.Exception: Image not found: /Awesome/Blocks/idkium.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1451)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1104)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.Exception: Image not found: /Awesome/Blocks/idkium.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1024)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1443)
... 5 more
--- END ERROR REPORT 7393aa9e ----------
So I read through it and thought, "Oh, I forgot to put the actual image in the minecraft.jar!" So I did that. I made a folder called 'Awesome' and a folder inside that called 'Blocks' and inside that I put the image called 'idkium.png'
But, then I ran Minecraft again, and it gave me the same error!
I'm confused, and I think the solution is something simple, but I don't know what it is!
Did you put it in the minecraft.jar in the jars folder? Also try mcp/bin/minecraft, or if you're using Eclipse, then put it in mcp/eclipse/Client/bin.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Your meant to create a .zip file with the class files and any images you linked to in it, then you place your .zip in the /mods folder that modloader creates.
Ok, so I tried that, and Minecraft gives me another, different error report.
Unfortunately, the error report shows up, and then minecraft closes! So, I can't read what it says!
Oh well, maybe something is messed up with my Minecraft.
package net.minecraft.src;
import java.util.Random;
public class mod_BlockIdkium extends Block
{
public mod_BlockIdkium(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random)
{
return 1;
}
}
Here is the new mod_Idkium.java:
package net.minecraft.src;
public class mod_Idkium extends BaseMod
{
public void load()
{
ModLoader.registerBlock(idkium);
ModLoader.addName(idkium, "Idkium Ore");
}
public static Block idkium;
static
{
idkium = (new mod_BlockIdkium(123, ModLoader.addOverride("/terrain.png", "/idkium.png"))).setHardness(3.5F).setResistance(5.0F).setBlockName("idkium");
}
public String getVersion()
{
return "Idkium v1.2.5_01";
}
}
Also, in line 14...
idkium = (new mod_BlockIdkium(123, ModLoader.addOverride("/terrain.png", "/idkium.png"))).setH... (I cut this part off)
I deleted the folder "Awesome" and the folder "Blocks" and just put the two class files and the image directly in the .zip that you told me to put in /mods.
I just copied and pasted both codes into EditRocket, so maybe there's one thing that was left out or something.
But otherwise, thanks for all the help so far!
I've been following multiple tutorials, some new, some old, and I'm already a beginner at java, so I've been getting confused.
So, thanks for all the help so far!
I hope I can finish this soon and work on more stuff!
I have made a mod where a new block is added to Minecraft. I eventually plan on making it into a new ore, but right now, it is just a block. After typing up the code in java (which I'm a beginner at), I recompiled it and reobfuscated it. Then, I put the two .class files into my %appdata%\Roaming\.minecraft\bin\minecraft.jar(which I opened with WinRAR) and installed those files like I would with any mod AND I installed ModLoader. I also put the texture file (in png format) into the minecraft.jar so that it could know what my block looks like.
Unfortunately, when I run Minecraft, everything goes normally until right after the Mojang logo. It says, "Minecraft has encountered a problem!" and then this:
I don't know what any of this means.
If anyone knows what this means, please explain! Also, please tell me how to fix it!
BlockIdkium.java:
mod_Idkium.java:
to
and
to
together they are powerful beyond imagination."
When I ran minecraft, It got to the Mojang logo, then crashed, saying:
So I read through it and thought, "Oh, I forgot to put the actual image in the minecraft.jar!" So I did that. I made a folder called 'Awesome' and a folder inside that called 'Blocks' and inside that I put the image called 'idkium.png'
But, then I ran Minecraft again, and it gave me the same error!
I'm confused, and I think the solution is something simple, but I don't know what it is!
@TechGuy543, thanks!
together they are powerful beyond imagination."
I'm not using Eclipse, I'm using EditRocket.
At least now I'm 99.99% done...
Ok, so I tried that, and Minecraft gives me another, different error report.
Unfortunately, the error report shows up, and then minecraft closes! So, I can't read what it says!
Oh well, maybe something is messed up with my Minecraft.
If anyone else can help, please do!
Here is the mod_BlockIdkium.java:
Here is the new mod_Idkium.java:
Also, in line 14...
I deleted the folder "Awesome" and the folder "Blocks" and just put the two class files and the image directly in the .zip that you told me to put in /mods.
I hope this helps!
I just copied and pasted both codes into EditRocket, so maybe there's one thing that was left out or something.
But otherwise, thanks for all the help so far!
I've been following multiple tutorials, some new, some old, and I'm already a beginner at java, so I've been getting confused.
So, thanks for all the help so far!
I hope I can finish this soon and work on more stuff!