I'm making a new food mod, but I get this ModLoader error, and I really dont know what is means:
jun 17, 2012 11:48:12 AM ModLoader init
FINE: ModLoader 1.2.5 Initializing...
jun 17, 2012 11:48:12 AM ModLoader readFromClassPath
FINER: Adding mods from C:\Users\Eigenaar\AppData\Roaming\.minecraft\bin\minecraft.jar
jun 17, 2012 11:48:12 AM ModLoader readFromClassPath
FINER: Zip found.
jun 17, 2012 11:48:12 AM ModLoader addMod
FINE: Failed to load mod from "mod_Morefood.class"
jun 17, 2012 11:48:12 AM ModLoader addMod
FINER: THROW
java.lang.ExceptionInInitializerError
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 ModLoader.addMod(ModLoader.java:294)
at ModLoader.readFromClassPath(ModLoader.java:1210)
at ModLoader.init(ModLoader.java:886)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:77)
at ahu.<clinit>(ahu.java:8)
at net.minecraft.client.Minecraft.a(SourceFile:273)
at net.minecraft.client.Minecraft.run(SourceFile:657)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 100257
at yr.<init>(SourceFile:272)
at amm.<init>(SourceFile:23)
at mod_Morefood.<clinit>(mod_Morefood.java:6)
... 15 more
jun 17, 2012 11:48:23 AM ModLoader readFromModFolder
FINER: Adding mods from C:\Users\Eigenaar\AppData\Roaming\.minecraft\mods\zombe
jun 17, 2012 11:48:23 AM ModLoader readFromModFolder
FINER: Directory found.
jun 17, 2012 11:48:23 AM ModLoader addAllRenderers
FINE: Initialized
Code:
mod_Morefood.java
package net.minecraft.src;
public class mod_Morefood extends BaseMod
{
//foods
public static final Item Cheese = new ItemFood(100001, 3, 1F, false).setItemName("Cheese");
//drinks
public static final Item HotMilk = new ItemFood(200001, 2, 1F, false).setPotionEffect(Potion.blindness.id, 10, 0, 0.4F).setItemName("HotMilk");
//items
public static final Item Flavor = new Flavor(300001).setItemName("Flavor");
public static final Item Aluminium = new Aluminium(300002).setItemName("Aluminium");
public void load()
{
//foods
Cheese.iconIndex = ModLoader.addOverride("/gui/items.png", "/Foodmod/Cheese.png");
ModLoader.addName(Cheese, "Cheese");
//drinks
HotMilk.iconIndex = ModLoader.addOverride("/gui/items.png", "/Foodmod/HotMilk.png");
ModLoader.addName(HotMilk, "Hot milk");
//items
Flavor.iconIndex = ModLoader.addOverride("/gui/items.png", "/Foodmod/Flavor.png");
ModLoader.addName(Flavor, "Flavor");
Aluminium.iconIndex = ModLoader.addOverride("/gui/items.png", "/Foodmod/Aluminium.png");
//crafting recipes
ModLoader.addRecipe(new ItemStack(Cheese, 1), new Object [] {"%", "#", "%", Character.valueOf('%'), HotMilk.shiftedIndex, Character.valueOf('#'), Flavor.shiftedIndex});
ModLoader.addRecipe(new ItemStack(Aluminium, 16), new Object [] {"###", Character.valueOf('#'), Item.ingotIron.shiftedIndex});
//smelting recipes
ModLoader.addSmelting(Item.bucketMilk.shiftedIndex, new ItemStack(HotMilk, 1));
ModLoader.addSmelting(Item.sugar.shiftedIndex, new ItemStack(Flavor, 1));
}
public mod_Morefood()
{
}
public String getVersion()
{
return "1.2.5";
}
}
Flavor.java:
package net.minecraft.src;
public class Flavor extends Item
{
public Flavor(int i)
{
super(i);
maxStackSize = 64;
}
}
Aluminium.java:
package net.minecraft.src;
public class Aluminium extends Item
{
public Aluminium(int i)
{
super(i);
maxStackSize = 64;
}
}
I hope you can help me!
Remove the Java constructor. Your item ids are too high aswell, the highest you can go is 32 000.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
You use the load method as the constructor in mod_ classes.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I am having a problem with the ore generation. I am able to generate any blocks already in Minecraft, but I am unable to generate a block from my mod.
It gives me the error when I try to generate a new world.
Here is the error:
--- BEGIN ERROR REPORT 5d36f889 --------
Generated 17/06/12 2:00 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_24, Sun Microsystems Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce 8200M G/PCI/SSE2 version 3.3.0, NVIDIA Corporation
java.lang.NullPointerException
at net.minecraft.src.mod_TehGimpsters.generateSurface(mod_TehGimpsters.java:188)
at net.minecraft.src.ModLoader.populateChunk(ModLoader.java:1217)
at net.minecraft.src.ChunkProvider.populate(ChunkProvider.java:196)
at net.minecraft.src.Chunk.populateChunk(Chunk.java:1150)
at net.minecraft.src.ChunkProvider.loadChunk(ChunkProvider.java:106)
at net.minecraft.src.ChunkProvider.provideChunk(ChunkProvider.java:119)
at net.minecraft.src.World.getChunkFromChunkCoords(World.java:654)
at net.minecraft.src.World.getBlockId(World.java:547)
at net.minecraft.client.Minecraft.preloadWorld(Minecraft.java:2258)
at net.minecraft.client.Minecraft.changeWorld(Minecraft.java:2145)
at net.minecraft.client.Minecraft.changeWorld2(Minecraft.java:2092)
at net.minecraft.client.Minecraft.startWorld(Minecraft.java:1972)
at net.minecraft.src.GuiCreateWorld.actionPerformed(GuiCreateWorld.java:217)
at net.minecraft.src.GuiScreen.mouseClicked(GuiScreen.java:107)
at net.minecraft.src.GuiCreateWorld.mouseClicked(GuiCreateWorld.java:327)
at net.minecraft.src.GuiScreen.handleMouseInput(GuiScreen.java:174)
at net.minecraft.src.GuiScreen.handleInput(GuiScreen.java:160)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1618)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:870)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Thread.java:662)
--- END ERROR REPORT 1aea1587 ----------
And here is my generateSurface:
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 20; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(100);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(boneOre.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
This is line 188 in mod_TehGimpsters:
(new WorldGenMinable(boneOre.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);
Also, if I try to change the "boneOre.blockID" to "mod_TehGimpsters.boneOre.blockID", it still gives the same error.
Instant Blocks Mod - 17 new blocks that generate structures upon right-click. Includes: Farm, Rainbow Skydive, Grinder, Escape Ladder, Water, Lava, Suction, and Statue Blocks.
With the sudden flow of people asking for entity help, I think it wise that I learn how to make a mob soon so that I can help people in this matter. As for now, I can only guess.
My guess would be to go into a pre-existing entity class and copy some of the code. Perhaps the code about tasks. (task.addTask)
Thanks to both of you. I used the Cow/Pig/Sheep (ModelQuadruped) to get him moving around properly. (I've also updated my model to look a LOT better )
However I have another problem. When trying to use the setColor() method for biomes (I'm assuming this is the biome shading for grass and leaves) I use a yellowish safari color, and I end up with an error because there are letters (etc.) inside my hexadecimal number.
Edit: Also, how to get Hippos to stop spawning in the Desert/Random biomes and only spawn in my custom biome?
This is a tutorial about modding with ModLoader. If you want to mod without ModLoader you have to search for your own (i dont want to make ad for other tutorials)
So now i want to say that this tutorial is simply AWESOME! You really did/do a great job! I hope someday i will as good as you in modding/programming..
But now a few questions;
1. I made an unbreakable Block with a dirt texture but when i walk over it it sounds like stone.. Why you haven't add the "setStepSound" Method to the Block-Tutorial? Example:
.setStepSound(Block.soundGravelFootstep)
2. I also added unbreakable wood & planks to the creative inventory and i can see the different woodtextures in the inventory but when i choose one and place it, i place a wood block with standart wood texture...
declaration:
public static final Block unbreakPlanks = (new BlockWood(134)).setBlockName("unbreakPlanks")
.setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundWoodFootstep).disableStats().setRequiresSelfNotify();
public static final Block unbreakWood = (new BlockLog(135)).setBlockName("unbreakWood")
.setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundWoodFootstep).disableStats().setRequiresSelfNotify();
add to creative inventory:
for (int i2 = 0; i2 < 4; i2++) {list.add(new ItemStack(unbreakPlanks, 1, i2));}
//shows the difficult woodtextures in the inventory
for (int i2 = 0; i2 < 4; i2++) {list.add(new ItemStack(unbreakWood, 1, i2));}
//but if you set the block it has the default texture ! >.<
I'm pretty sure to make a block truly unbreakable, you need to set its hardness to -1F. Anyways, where are you pulling that for loop from in your code to add stuff to creative inventory? There's no for loop at all in the tutorial Techguy offers on that... The tutorial for that is under the Fuels tutorial.
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
I'm going to suggest putting finished, post-1.0 mods made with your tutorials in a spoiler, to show how much people you have helped. Maybe make an email or something.
I am having a problem with the ore generation. I am able to generate any blocks already in Minecraft, but I am unable to generate a block from my mod.
It gives me the error when I try to generate a new world.
Here is the error:
--- BEGIN ERROR REPORT 5d36f889 --------
Generated 17/06/12 2:00 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_24, Sun Microsystems Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce 8200M G/PCI/SSE2 version 3.3.0, NVIDIA Corporation
java.lang.NullPointerException
at net.minecraft.src.mod_TehGimpsters.generateSurface(mod_TehGimpsters.java:188)
at net.minecraft.src.ModLoader.populateChunk(ModLoader.java:1217)
at net.minecraft.src.ChunkProvider.populate(ChunkProvider.java:196)
at net.minecraft.src.Chunk.populateChunk(Chunk.java:1150)
at net.minecraft.src.ChunkProvider.loadChunk(ChunkProvider.java:106)
at net.minecraft.src.ChunkProvider.provideChunk(ChunkProvider.java:119)
at net.minecraft.src.World.getChunkFromChunkCoords(World.java:654)
at net.minecraft.src.World.getBlockId(World.java:547)
at net.minecraft.client.Minecraft.preloadWorld(Minecraft.java:2258)
at net.minecraft.client.Minecraft.changeWorld(Minecraft.java:2145)
at net.minecraft.client.Minecraft.changeWorld2(Minecraft.java:2092)
at net.minecraft.client.Minecraft.startWorld(Minecraft.java:1972)
at net.minecraft.src.GuiCreateWorld.actionPerformed(GuiCreateWorld.java:217)
at net.minecraft.src.GuiScreen.mouseClicked(GuiScreen.java:107)
at net.minecraft.src.GuiCreateWorld.mouseClicked(GuiCreateWorld.java:327)
at net.minecraft.src.GuiScreen.handleMouseInput(GuiScreen.java:174)
at net.minecraft.src.GuiScreen.handleInput(GuiScreen.java:160)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1618)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:870)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Thread.java:662)
--- END ERROR REPORT 1aea1587 ----------
And here is my generateSurface:
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 20; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(100);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(boneOre.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
This is line 188 in mod_TehGimpsters:
(new WorldGenMinable(boneOre.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);
Also, if I try to change the "boneOre.blockID" to "mod_TehGimpsters.boneOre.blockID", it still gives the same error.
Thank you in advance.
I'm still having the error. If anyone code help, please do.
Rollback Post to RevisionRollBack
Instant Blocks Mod - 17 new blocks that generate structures upon right-click. Includes: Farm, Rainbow Skydive, Grinder, Escape Ladder, Water, Lava, Suction, and Statue Blocks.
How can you make ores generate in the nether? Do you just change 'generateSurface' to 'generateUnderWorld'? lol its a wild guess.
You'll have to create a new WorldGenMinable class. Call it "NetherGenMinable" or something of the sort. Once created, copy all code from WorldGenMinable into the new one, and replace whatever variables necessary to make the new name work. (Just all of the WorldGenMinable to the new name)
Once that's done, scroll down to the bottom of the new class and replace
Block.stone.blockID
With this:
Block.netherrack.blockID
Then, go back into your mod_* class and create an entirely new public void generate. Adding a new for loop into the previous one will break any newly-generated world. So, basically, just copy your entire public void generateSurface and paste it under the old one. Rename it to public void generateNether or something of that sort, and add your ore to that in a similar manner to the generateSurface except on your last line in the for loop, use new NetherGenMinable instead.
Example:(shows generateSurface with generateNether right under it)
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int Example1 = 0; Example1 < 10; Example1++)
{
int Example1X = chunkX + random.nextInt(16);
int Example1Y = random.nextInt(20);
int Example1Z = chunkZ + random.nextInt(16);
(new WorldGenMinable(Example1 .blockID, 4)).generate(world, random, Example1X, Example1Y, Example1Z);
}
for(int Example2 = 0; Example2 < 120; Example2++)
{
int Example2X = chunkX + random.nextInt(16);
int Example2Y = random.nextInt(128);
int Example2Z = chunkZ + random.nextInt(16);
(new WorldGenMinable(Example2.blockID, 3)).generate(world, random, Example2X, Example2Y, Example2Z);
}
}
public void generateNether(World world, Random random, int chunkX, int chunkZ)
{
for(int NetherExample = 0; NetherExample < 80; NetherExample++)
{
int NetherExampleX = chunkX + random.nextInt(16);
int NetherExampleY = random.nextInt(128);
int NetherExampleZ = chunkZ + random.nextInt(16);
(new NetherGenMinable(NetherExample.blockID, 25)).generate(world, random, NetherExampleX, NetherExampleY, NetherExampleZ);
}
}
I'm still having the error. If anyone code help, please do.
Are you putting multiple ores into the samepublic void generateSurface? You're supposed to have multiple for loops in them, not just copy and paste the entire thing. Here's an example:
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int OreOne = 0; OreOne < 10; OreOne++)
{
int OreOneX = chunkX + random.nextInt(16);
int OreOneY = random.nextInt(20);
int OreOneZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(OreOne.blockID, 4)).generate(world, random, OreOneX, OreOneY, OreOneZ);
}
for(int boneOre = 0; boneOre < 120; boneOre++)
{
int boneOreX = chunkX + random.nextInt(16);
int boneOreY = random.nextInt(128);
int boneOreZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(boneOre.blockID, 3)).generate(world, random, boneOreX, boneOreY, boneOreZ);
}
}
Edit: Or if that's not the problem, then be sure you declared your ore and everything correctly outside of the world generation code. It might not be the generation at all giving you the error.
I downloaded JDK and all (MCP, Eclipse) and using Notepad ++, i made a block called 'test' and following the instructions, i have a mod_Test.java and a Test.java. I imported them into eclipse, and i realize i need to compile them into mod_Test.class and Test.class. Is there a way to do that with eclipse? I know there is a way with command prompt, but Is there an easier way with eclipse? Also, once i have the class files, what do I do with them? How would I know they made it successfuly into minecraft.
After taking a look at some mods, I see they have a zip folder with the mod's name on it, and inside are class files. but for example, like buildcraft 3.1.5 energy folder has a folder at the top, 'buildcraft', with the content in nice labeled class form. then beneath that is buildcraftenergy.class, which i could relate to 'block.class' from the tutorials. then is the mod_buildcraftenergy.class, which i could relate to 'mod_block.class'. In a zip folder, after compiling, would I just put 'block.class and mod_block.class in a zip folder and put it in the mods folder of a .minecraft? (using multimc)
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
I downloaded JDK and all (MCP, Eclipse) and using Notepad ++, i made a block called 'test' and following the instructions, i have a mod_Test.java and a Test.java. I imported them into eclipse, and i realize i need to compile them into mod_Test.class and Test.class. Is there a way to do that with eclipse? I know there is a way with command prompt, but Is there an easier way with eclipse? Also, once i have the class files, what do I do with them? How would I know they made it successfuly into minecraft.
A step-by-step...
Download MCP
Make a folder with MCP inside it, this will be your workspace
Get a clean minecraft.jar, delete META-INF and install modloader to it
Copy and paste the entire bin folder to your MCP directory > jars
Go back to your MCP directory, and run decompile.bat
Once decompiled, open eclipse and set the workspace to your MCP directory\eclipse
Create all your .java files within eclipse, do some coding...
Go to File at the top bar and hit save all (You'll need to fix something if it says you have more than 2 errors)
Go back to your MCP directory and run recompile.bat
Run startclient.bat and test your game to see if your mod works
If so, close client, and run reobfuscate.bat (This turns all the .java you made into .class and places them into your MCP directory > reobf > minecraft)
add all files into a zip file container (don't forget to include your textures if you made any)
either install the contents of the zip file into your .jar or just copy and paste the whole zip into mods folder located in .minecraft, depending on how you have things set up (.jar if only using modloader, mods folder if using forge)
Congrats.
I'd give a more detailed explanation... But I literally just rolled out of bed.
After taking a look at some mods, I see they have a zip folder with the mod's name on it, and inside are class files. but for example, like buildcraft 3.1.5 energy folder has a folder at the top, 'buildcraft', with the content in nice labeled class form. then beneath that is buildcraftenergy.class, which i could relate to 'block.class' from the tutorials. then is the mod_buildcraftenergy.class, which i could relate to 'mod_block.class'. In a zip folder, after compiling, would I just put 'block.class and mod_block.class in a zip folder and put it in the mods folder of a .minecraft? (using multimc)
Buildcraft and a lot of more advanced mods are coded using ModLoader and Forge. The tutorials here only cover using ModLoader.
"I downloaded JDK and all (MCP, Eclipse) and using Notepad ++" Why would you download Eclipse if you're using Notepad++? Or why would you use Notepad++ if you've downloaded Eclipse? If you didn't know, Eclipse is just a text editor, like Notepad++. And it is a way better one as well. It looks to me like you need to read through the basics of this tutorial. It tells you about all the stuff you asked about, and it is pretty useful to know how to use the programs you're modding with, right?
Make a folder with MCP inside it, this will be your workspace
Get a clean minecraft.jar, delete META-INF and install modloader to it
Copy and paste the entire bin folder to your MCP directory > jars
Go back to your MCP directory, and run decompile.bat
Once decompiled, open eclipse and set the workspace to your MCP directory\eclipse
Create all your .java files within eclipse, do some coding...
Go to File at the top bar and hit save all (You'll need to fix something if it says you have more than 2 errors)
Go back to your MCP directory and run recompile.bat
Run startclient.bat and test your game to see if your mod works
If so, close client, and run reobfuscate.bat (This turns all the .java you made into .class and places them into your MCP directory > reobf > minecraft)
add all files into a zip file container (don't forget to include your textures if you made any)
either install the contents of the zip file into your .jar or just copy and paste the whole zip into mods folder located in .minecraft, depending on how you have things set up (.jar if only using modloader, mods folder if using forge)
Congrats.
I'd give a more detailed explanation... But I literally just rolled out of bed.
Buildcraft and a lot of more advanced mods are coded using ModLoader and Forge. The tutorials here only cover using ModLoader.
Thanks for the help!
-Raggarcowboy: So i dont' need notepad++. oh well, i use it in place of wordpad anyways.
-ZeroLevels: Thanks for the tutorial! I imported mod_test.java into eclipse and wrote test.java in eclipse. But i'm getting a lot of errors. I think i shouldn't report them on this thread, but most of them (22) are like 'x cannot be resolved to a type/variable'.
Also, if i wanted to check if my block made it successfully into the game, how would i do that? Would i just install TMI or something? I also want to check if the recipe i made is working.
Rollback Post to RevisionRollBack
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
-Raggarcowboy: So i dont' need notepad++. oh well, i use it in place of wordpad anyways.
-ZeroLevels: Thanks for the tutorial! I imported mod_test.java into eclipse and wrote test.java in eclipse. But i'm getting a lot of errors. I think i shouldn't report them on this thread, but most of them (22) are like 'x cannot be resolved to a type/variable'.
Also, if i wanted to check if my block made it successfully into the game, how would i do that? Would i just install TMI or something? I also want to check if the recipe i made is working.
In order to fully understand the problem, I'd need to see the code and if possible to provide it, the error code. (Error code not absolutely necessary though) If you don't feel secure in showing them in an open thread, you can send them to me in a private message and I'll try to point out what is wrong/out of place.
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
In order to fully understand the problem, I'd need to see the code and if possible to provide it, the error code. (Error code not absolutely necessary though) If you don't feel secure in showing them in an open thread, you can send them to me in a private message and I'll try to point out what is wrong/out of place.
Nah i mean it isn't private code (code for a block named Test) but i remember that in the OP there was a line stating code shouldn't be put here?
Here it is anyways. In spoilers so people won't get annoyed!
mod_Test.java
package net.minecraft.src;
public class mod_Test extends BaseMod
{
public static final Test = new Test(200,
10).setBlockName("Test").setHardness(2F).setResistance(1000F).setLightValue(15F);
public void load()
{
ModLoader.registerBlock(Test);
ModLoader.addName(Test, "Faith");
ModLoader.addRecipe(new ItemStack(Test, 3), new Object [] {"#@#", "@#@", "#@#",
Character.valueOf('#'), Block.stone, Character.valueOf('@'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
Test.java
package net.minecraft.src;
importjava.util.Random;
public class Test extends Block
{
public Test(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Test.Test.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
I think error code? i just highlighted all the errors in eclipse and pasted them here.
The project cannot be built until build path errors are resolved Server Unknown Java Problem
The method setBlockName(String) is undefined for the type Test mod_Test.java /Client/src/net/minecraft/client line 6 Java Problem
The declared package "net.minecraft.src" does not match the expected package "net.minecraft.client" Test.java /Client/src/net/minecraft/client line 1 Java Problem
The declared package "net.minecraft.src" does not match the expected package "net.minecraft.client" mod_Test.java /Client/src/net/minecraft/client line 1 Java Problem
Syntax error on token ";", import expected after this token Test.java /Client/src/net/minecraft/client line 1 Java Problem
Random cannot be resolved to a type Test.java /Client/src/net/minecraft/client line 11 Java Problem
Random cannot be resolved to a type Test.java /Client/src/net/minecraft/client line 15 Java Problem
Project 'Server' is missing required library: 'jars/minecraft_server.jar' Server Build path Build Path Problem
ModLoader cannot be resolved mod_Test.java /Client/src/net/minecraft/client line 10 Java Problem
ModLoader cannot be resolved mod_Test.java /Client/src/net/minecraft/client line 11 Java Problem
ModLoader cannot be resolved mod_Test.java /Client/src/net/minecraft/client line 12 Java Problem
Material cannot be resolved to a variable Test.java /Client/src/net/minecraft/client line 8 Java Problem
ItemStack cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 12 Java Problem
Block cannot be resolved to a variable mod_Test.java /Client/src/net/minecraft/client line 13 Java Problem
Block cannot be resolved to a variable mod_Test.java /Client/src/net/minecraft/client line 13 Java Problem
Block cannot be resolved to a type Test.java /Client/src/net/minecraft/client line 4 Java Problem
Block cannot be resolved to a type Test.java /Client/src/net/minecraft/client line 13 Java Problem
Block cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 5 Java Problem
Block cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 10 Java Problem
Block cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 11 Java Problem
Block cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 12 Java Problem
BaseMod cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 3 Java Problem
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
Nah i mean it isn't private code (code for a block named Test) but i remember that in the OP there was a line stating code shouldn't be put here?
Here it is anyways. In spoilers so people won't get annoyed!
mod_Test.java
package net.minecraft.src;
public class mod_Test extends BaseMod
{
public static final Test = new Test(200,
10).setBlockName("Test").setHardness(2F).setResistance(1000F).setLightValue(15F);
public void load()
{
ModLoader.registerBlock(Test);
ModLoader.addName(Test, "Faith");
ModLoader.addRecipe(new ItemStack(Test, 3), new Object [] {"#@#", "@#@", "#@#",
Character.valueOf('#'), Block.stone, Character.valueOf('@'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
Test.java
package net.minecraft.src;
importjava.util.Random;
public class Test extends Block
{
public Test(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Test.Test.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
I think error code? i just highlighted all the errors in eclipse and pasted them here.
The project cannot be built until build path errors are resolved Server Unknown Java Problem
The method setBlockName(String) is undefined for the type Test mod_Test.java /Client/src/net/minecraft/client line 6 Java Problem
The declared package "net.minecraft.src" does not match the expected package "net.minecraft.client" Test.java /Client/src/net/minecraft/client line 1 Java Problem
The declared package "net.minecraft.src" does not match the expected package "net.minecraft.client" mod_Test.java /Client/src/net/minecraft/client line 1 Java Problem
Syntax error on token ";", import expected after this token Test.java /Client/src/net/minecraft/client line 1 Java Problem
Random cannot be resolved to a type Test.java /Client/src/net/minecraft/client line 11 Java Problem
Random cannot be resolved to a type Test.java /Client/src/net/minecraft/client line 15 Java Problem
Project 'Server' is missing required library: 'jars/minecraft_server.jar' Server Build path Build Path Problem
ModLoader cannot be resolved mod_Test.java /Client/src/net/minecraft/client line 10 Java Problem
ModLoader cannot be resolved mod_Test.java /Client/src/net/minecraft/client line 11 Java Problem
ModLoader cannot be resolved mod_Test.java /Client/src/net/minecraft/client line 12 Java Problem
Material cannot be resolved to a variable Test.java /Client/src/net/minecraft/client line 8 Java Problem
ItemStack cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 12 Java Problem
Block cannot be resolved to a variable mod_Test.java /Client/src/net/minecraft/client line 13 Java Problem
Block cannot be resolved to a variable mod_Test.java /Client/src/net/minecraft/client line 13 Java Problem
Block cannot be resolved to a type Test.java /Client/src/net/minecraft/client line 4 Java Problem
Block cannot be resolved to a type Test.java /Client/src/net/minecraft/client line 13 Java Problem
Block cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 5 Java Problem
Block cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 10 Java Problem
Block cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 11 Java Problem
Block cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 12 Java Problem
BaseMod cannot be resolved to a type mod_Test.java /Client/src/net/minecraft/client line 3 Java Problem
Alrighty. Let's see here.
Firstly, you're making a new block, so you need to tell it that in your declaration. So, your public static final should look something like this:
public static final Block Test = new Test(200, 10).setBlockName("Test").setHardness(2F).setResistance(1000F).setLightValue(15F);
And since you have the number next to the blockID set to 10, it'll come out looking like all sides are made of the bottom of TNT. But this is a test, so that's fine.
That I can tell, that's really the only problem. But all those errors look like it's not registering that ModLoader is installed to the minecraft.jar... Did you install it to the .jar before decompiling?
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
To post a comment, please login or register a new account.
Remove the Java constructor. Your item ids are too high aswell, the highest you can go is 32 000.
together they are powerful beyond imagination."
public mod_Morefood() { }You use the load method as the constructor in mod_ classes.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIt gives me the error when I try to generate a new world.
Here is the error:
And here is my generateSurface:
public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int i = 0; i < 20; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(100); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(boneOre.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ); } }This is line 188 in mod_TehGimpsters:
Also, if I try to change the "boneOre.blockID" to "mod_TehGimpsters.boneOre.blockID", it still gives the same error.
Thank you in advance.
Instant Blocks Mod - 17 new blocks that generate structures upon right-click. Includes: Farm, Rainbow Skydive, Grinder, Escape Ladder, Water, Lava, Suction, and Statue Blocks.
Thanks to both of you. I used the Cow/Pig/Sheep (ModelQuadruped) to get him moving around properly. (I've also updated my model to look a LOT better
However I have another problem. When trying to use the setColor() method for biomes (I'm assuming this is the biome shading for grass and leaves) I use a yellowish safari color, and I end up with an error because there are letters (etc.) inside my hexadecimal number.
Edit: Also, how to get Hippos to stop spawning in the Desert/Random biomes and only spawn in my custom biome?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffI'm pretty sure to make a block truly unbreakable, you need to set its hardness to -1F. Anyways, where are you pulling that for loop from in your code to add stuff to creative inventory? There's no for loop at all in the tutorial Techguy offers on that... The tutorial for that is under the Fuels tutorial.
this is what the recompiler said
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) == # found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, param csvs, astyle, astyle config == Recompiling client == > Cleaning bin > Recompiling '"C:\Program Files\Java\jdk1.7.0_03\bin\javac" -Xlint:-options -deprecation -g -source 1.6 -target 1....' failed : 1 == ERRORS FOUND == src\minecraft\net\minecraft\src\mod_The_Random_Mod.java:5: error: cannot find symbol public static final Block retardOre = new BlockretardOre(160, 0).setBlockName("retardOre").setHardness(3F).setResistance(4F).setLightValue(1F); ^ symbol: class BlockretardOre location: class mod_The_Random_Mod 1 error ================== !! Can not find server sources, try decompiling !! Press any key to continue . . .My code is this(the file that has the error in it, my other file is fine)
package net.minecraft.src; public class mod_The_Random_Mod extends BaseMod { public static final Block retardOre = new BlockretardOre(160, 0).setBlockName("retardOre").setHardness(3F).setResistance(4F).setLightValue(1F); public void load() { retardOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/therandommod/retardOre.png"); ModLoader.registerBlock(retardOre); ModLoader.addName(retardOre, "Retard Ore"); ModLoader.addRecipe(new ItemStack(retardOre, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt}); } public String getVersion() { return "1.2.5"; } }-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI'm still having the error. If anyone code help, please do.
Instant Blocks Mod - 17 new blocks that generate structures upon right-click. Includes: Farm, Rainbow Skydive, Grinder, Escape Ladder, Water, Lava, Suction, and Statue Blocks.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffYou'll have to create a new WorldGenMinable class. Call it "NetherGenMinable" or something of the sort. Once created, copy all code from WorldGenMinable into the new one, and replace whatever variables necessary to make the new name work. (Just all of the WorldGenMinable to the new name)
Once that's done, scroll down to the bottom of the new class and replace
With this:
Then, go back into your mod_* class and create an entirely new public void generate. Adding a new for loop into the previous one will break any newly-generated world. So, basically, just copy your entire public void generateSurface and paste it under the old one. Rename it to public void generateNether or something of that sort, and add your ore to that in a similar manner to the generateSurface except on your last line in the for loop, use new NetherGenMinable instead.
Example: (shows generateSurface with generateNether right under it)
public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int Example1 = 0; Example1 < 10; Example1++) { int Example1X = chunkX + random.nextInt(16); int Example1Y = random.nextInt(20); int Example1Z = chunkZ + random.nextInt(16); (new WorldGenMinable(Example1 .blockID, 4)).generate(world, random, Example1X, Example1Y, Example1Z); } for(int Example2 = 0; Example2 < 120; Example2++) { int Example2X = chunkX + random.nextInt(16); int Example2Y = random.nextInt(128); int Example2Z = chunkZ + random.nextInt(16); (new WorldGenMinable(Example2.blockID, 3)).generate(world, random, Example2X, Example2Y, Example2Z); } } public void generateNether(World world, Random random, int chunkX, int chunkZ) { for(int NetherExample = 0; NetherExample < 80; NetherExample++) { int NetherExampleX = chunkX + random.nextInt(16); int NetherExampleY = random.nextInt(128); int NetherExampleZ = chunkZ + random.nextInt(16); (new NetherGenMinable(NetherExample.blockID, 25)).generate(world, random, NetherExampleX, NetherExampleY, NetherExampleZ); } }Are you putting multiple ores into the same public void generateSurface? You're supposed to have multiple for loops in them, not just copy and paste the entire thing. Here's an example:
public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int OreOne = 0; OreOne < 10; OreOne++) { int OreOneX = chunkX + random.nextInt(16); int OreOneY = random.nextInt(20); int OreOneZ = chunkZ + random.nextInt(16); (new WorldGenMinable(OreOne.blockID, 4)).generate(world, random, OreOneX, OreOneY, OreOneZ); } for(int boneOre = 0; boneOre < 120; boneOre++) { int boneOreX = chunkX + random.nextInt(16); int boneOreY = random.nextInt(128); int boneOreZ = chunkZ + random.nextInt(16); (new WorldGenMinable(boneOre.blockID, 3)).generate(world, random, boneOreX, boneOreY, boneOreZ); } }Edit: Or if that's not the problem, then be sure you declared your ore and everything correctly outside of the world generation code. It might not be the generation at all giving you the error.
After taking a look at some mods, I see they have a zip folder with the mod's name on it, and inside are class files. but for example, like buildcraft 3.1.5 energy folder has a folder at the top, 'buildcraft', with the content in nice labeled class form. then beneath that is buildcraftenergy.class, which i could relate to 'block.class' from the tutorials. then is the mod_buildcraftenergy.class, which i could relate to 'mod_block.class'. In a zip folder, after compiling, would I just put 'block.class and mod_block.class in a zip folder and put it in the mods folder of a .minecraft? (using multimc)
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
ps: i know how to create a block and ty for u tutorial
Please help!!!
-
View User Profile
-
View Posts
-
Send Message
Retired StaffA step-by-step...
- Download MCP
- Make a folder with MCP inside it, this will be your workspace
- Get a clean minecraft.jar, delete META-INF and install modloader to it
- Copy and paste the entire bin folder to your MCP directory > jars
- Go back to your MCP directory, and run decompile.bat
- Once decompiled, open eclipse and set the workspace to your MCP directory\eclipse
- Create all your .java files within eclipse, do some coding...
- Go to File at the top bar and hit save all (You'll need to fix something if it says you have more than 2 errors)
- Go back to your MCP directory and run recompile.bat
- Run startclient.bat and test your game to see if your mod works
- If so, close client, and run reobfuscate.bat (This turns all the .java you made into .class and places them into your MCP directory > reobf > minecraft)
- add all files into a zip file container (don't forget to include your textures if you made any)
- either install the contents of the zip file into your .jar or just copy and paste the whole zip into mods folder located in .minecraft, depending on how you have things set up (.jar if only using modloader, mods folder if using forge)
- Congrats.
I'd give a more detailed explanation... But I literally just rolled out of bed.Buildcraft and a lot of more advanced mods are coded using ModLoader and Forge. The tutorials here only cover using ModLoader.
Read the "Getting Set-Up" part of this tutorial... The one at the very top at the first page. JDK = Java Development Kit
Thanks for the help!
-Raggarcowboy: So i dont' need notepad++. oh well, i use it in place of wordpad anyways.
-ZeroLevels: Thanks for the tutorial! I imported mod_test.java into eclipse and wrote test.java in eclipse. But i'm getting a lot of errors. I think i shouldn't report them on this thread, but most of them (22) are like 'x cannot be resolved to a type/variable'.
Also, if i wanted to check if my block made it successfully into the game, how would i do that? Would i just install TMI or something? I also want to check if the recipe i made is working.
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
If your first language is not english, please try to explain better.
If your first language is english, then learn english again.
If i understand correctly, you are asking 'how to make it so I can put my mod into the game?"
If that is the case, then look a few posts up. I asked that question only days before.
If it is not then elaborate on your dilemma.
Or you can just look at provided explanation by Raggarcowboy, below.
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffIn order to fully understand the problem, I'd need to see the code and if possible to provide it, the error code. (Error code not absolutely necessary though) If you don't feel secure in showing them in an open thread, you can send them to me in a private message and I'll try to point out what is wrong/out of place.
Nah i mean it isn't private code (code for a block named Test) but i remember that in the OP there was a line stating code shouldn't be put here?
Here it is anyways. In spoilers so people won't get annoyed!
mod_Test.java
package net.minecraft.src; public class mod_Test extends BaseMod { public static final Test = new Test(200, 10).setBlockName("Test").setHardness(2F).setResistance(1000F).setLightValue(15F); public void load() { ModLoader.registerBlock(Test); ModLoader.addName(Test, "Faith"); ModLoader.addRecipe(new ItemStack(Test, 3), new Object [] {"#@#", "@#@", "#@#", Character.valueOf('#'), Block.stone, Character.valueOf('@'), Block.dirt}); } public String getVersion() { return "1.2.5"; } }Test.java
package net.minecraft.src; importjava.util.Random; public class Test extends Block { public Test(int i, int j) { super(i, j, Material.wood); } public int idDropped(int i, Random random, int j) { return mod_Test.Test.blockID; } public int quantityDropped(Random random) { return 1; }}I think error code? i just highlighted all the errors in eclipse and pasted them here.
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffAlrighty. Let's see here.
Firstly, you're making a new block, so you need to tell it that in your declaration. So, your public static final should look something like this:
public static final Block Test = new Test(200, 10).setBlockName("Test").setHardness(2F).setResistance(1000F).setLightValue(15F);And since you have the number next to the blockID set to 10, it'll come out looking like all sides are made of the bottom of TNT. But this is a test, so that's fine.
That I can tell, that's really the only problem. But all those errors look like it's not registering that ModLoader is installed to the minecraft.jar... Did you install it to the .jar before decompiling?