package net.minecraft.src;
import java.util.Random;
public class ItemCantalope extends Item
{
public static final Item ItemCantalope(int i int j);
{
super(i);
healAmount = j;
maxStackSize = 64;
}
public (ItemStack onItemRightClick (ItemStack itemstack, World world, EntityPlayer entityplayer); {}
}
package net.minecraft.src;
import java.util.Random;
public class ItemCantalope extends Item
{
public static final Item ItemCantalope(int i int j);
{
super(i);
healAmount = j;
maxStackSize = 64;
}
public (ItemStack onItemRightClick (ItemStack itemstack, World world, EntityPlayer entityplayer); {}
}
Trying to make a cantalope slice as food.
Remove
static final Item
from the
public static final Item ItemCantalope(int i int j);
{
Method, plus remove the semicolon at the end of it
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:265)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1214)
at net.minecraft.src.ModLoader.init(ModLoader.java:733)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:162)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:104)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:42)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:314)
at net.minecraft.client.Minecraft.run(Minecraft.java:613)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NullPointerException
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:303)
at net.minecraft.src.ModLoader.AddRecipe(ModLoader.java:372)
at net.minecraft.src.mod_ExtraCraft.<clinit>(mod_ExtraCraft.java:204)
... 15 more
--- END ERROR REPORT 6e730da5 ----------
ok, so i was trying to make like a test mod to get started, and these r my codes:
mod_test
package net.minecraft.src;
public class mod_Test extends Basemod
{
public static final Block Test = new Block(100, 0).setHardness(1.5F).setResistance(10F).setStepSound(Block.soundStoneFootstep).setBlockName("Test");
public mod_Test()
{
ModLoader.registerBlock(Test);
ModLoader.Addname(Test,"Pie");
Test.blockIndexInTexture = ModLoader.addOverride("/terrian.png", "/Test/Test.png");
}
public String Version()
{
return "10.0";
}
}
and then:
BlockTest
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// Block, Material
public class BlockTest extends Block
{
public BlockTest(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return blockID;
}
}
package net.minecraft.src;
import java.util.Random;
public class mod_Mining extends BaseMod
{
//==================== Grabbing Machine ====================
public static final Block copperBlock = new BlockCopper(123,0).setHardness(3F).setResistance(5F).setBlockName("Copper");
public static final Block tinBlock = new BlockTin(124,0).setHardness(3F).setResistance(5F).setBlockName("Tin");
public static Item copperIngot;
public static Item tinIngot;
public static Item bronzeIngot;
public void load()
{
//==================== Copper ====================
ModLoader.RegisterBlock(copperBlock);
copperBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/CopperBlock.png");
ModLoader.AddName(copperBlock, "Copper Ore");
ModLoader.AddSmelting(copperBlock.blockID, new ItemStack(copperIngot, 1, 0));
copperIngot = new Item(15300).setItemName("Copper Ingot");
copperIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/CopperIngot.png");
ModLoader.AddName(copperIngot, "Copper Ingot");
//==================== Tin ====================
ModLoader.RegisterBlock(tinBlock);
tinBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/TinBlock.png");
ModLoader.AddName(tinBlock, "Tin Ore");
ModLoader.AddSmelting(tinBlock.blockID, new ItemStack(tinIngot, 1, 0));
tinIngot = new Item(15301).setItemName("Tin Ingot");
tinIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/TinIngot.png");
ModLoader.AddName(tinIngot, "Tin Ingot");
//==================== Bronze ====================
bronzeIngot = new Item(15302).setItemName("Bronze Ingot");
bronzeIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/BronzeIngot.png");
ModLoader.AddName(bronzeIngot, "Bronze Ingot");
ModLoader.AddRecipe(new ItemStack(bronzeIngot, 1), new Object []{
"#%", Character.valueOf('#'), copperIngot, Character.valueOf('%'), tinIngot});
//==================== Very Important, do not touch ====================
}
//==================== World Generator ====================
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for (int a1=0; a1 < 250; a1++);
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(128);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(copperBlock.blockID, 10)).generate(world, rand, randPosX, randPosY, randPosZ);
(new WorldGenMinable(tinBlock.blockID, 10)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
//==================== Game Version Checker ====================
public String getVersion()
{
return "1.0.0";
}
}
Mods loaded: 2
ModLoader 1.0.0
net.minecraft.src.mod_Mining 1.0.0
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
If you wish to report this, please copy this entire text and email it to [email protected].
Please include a description of what you did when the error occured.
--- BEGIN ERROR REPORT a77dfbd8 --------
Generated 12/28/11 11:34 PM
Minecraft: Minecraft 1.0.0
OS: Windows 7 (x86) version 6.1
Java: 1.6.0_26, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: Intel(R) HD Graphics version 2.1.0 - Build 8.15.10.2119, Intel
java.lang.NullPointerException
at net.minecraft.src.ItemStack.<init>(ItemStack.java:51)
at net.minecraft.src.mod_Mining.load(mod_Mining.java:20)
at net.minecraft.src.ModLoader.init(ModLoader.java:739)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:162)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:104)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:42)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:314)
at net.minecraft.client.Minecraft.run(Minecraft.java:613)
at java.lang.Thread.run(Thread.java:662)
--- END ERROR REPORT 82c9eed8 ----------
Don't know if that will fix some of the other errors. Ohh and when you lauch the mod it will crash because your block got the id 100 which is already used by a vanilla block. You need an id between 123-255.
and I think
public static final Block Test = new Block(100, 0).setHardness(1.5F).setResistance(10F).setStepSound(Block.soundStoneFootstep).setBlockName("Test");
Would instead be
public static final Block Test = new BlockTest(145, 0).setHardness(1.5F).setResistance(1.0F).setStepSound(Block.soundStoneFootstep).setBlockName("Test");
You are missing the name of the Block over beside the Id
Edit: your code will only work in 1.8. There where a few changes in modloader for 1.0
Ohh can you post this new errors and the new code?
yea
BlockTest:
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// Block, Material
public class BlockTest extends Block
{
public BlockTest(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return blockID;
}
}
mod_test:
package net.minecraft.src;
public class mod_Test extends Basemod
{
public static final Block Test = new Block(145, 0).setHardness(1.5F).setResistance(1.0F).setStepSound(Block.soundStoneFootstep).setBlockName("Test");
public void load()
{
ModLoader.registerBlock(Test);
ModLoader.Addname(Test,"Pie");
Test.blockIndexInTexture = ModLoader.addOverride("/terrian.png", "/Test/Test.png");
}
public String getVersion()
{
return "10.0";
}
}
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\mod_GP.java:3: error: mod_GP is not abstract and
does not override abstract method getVersion() in BaseMod
public class mod_GP extends BaseMod
^
And I was wondering what it meant.
The Code (Sorry I don't know how to make a spoiler.
package net.minecraft.src;
public class mod_GP extends BaseMod
{
public static Block Keg = new BlockKeg(190, 0).setHardness(1.0F).setResistance(6.0F).setBlockName("Keg");
[spoiler]package net.minecraft.src;
import java.util.Random;
public class BlockCreeperOre extends Block
{
public BlockCreeperOre(int i, int j)
{
super(i, j, Material.ground);
}
protected int getDropEntityId()
{
return Entity.spider.entityIndex;
}
public void dropFewItems(boolean flag, int i)
{
super.dropFewItems(flag, i);
if(flag && (rand.nextInt(3) == 0 || rand.nextInt(1 + i) > 0))
{
dropItem(Item.spiderEye.shiftedIndex, 1);
}
}
}
[/spoiler]
I added everything required for it to drop more than one item, but it won't. Different items I mean. I edited modloaders Block.JAVA file via eclipse to do so. But what I want to do is render it so that it drops an entity...
Rollback Post to RevisionRollBack
Did I help you? There's a little white plus down the bottom. I hope your confused!
uhh, I recently (earlier this morning) have made a topic saying "How do you make multiple world generations?" and apperantly someone deleted it so I am going to ask, How do you make multiple world gens such as trees... I found out how to make a ton of ores so I know it can be done sort of like that.
Please help!
i'VE got minecraft cracked (for a test of mods before buying it) and i've got magic launcher
i've installed modloader , modloader MP (cus i've got a server) minecraft forge and optifine (for some mods) and mo'creatures (with all the other usefull mods),MaTmos mod and sign tags mod and i've runed minecraft and all mods worked fine... but when i closed minecraft,and when i started minecaft again, in both starters i get a crash and in the magic launcher's mods list i've got 3 errors in mod loader,24 errors in minecraft forge and the audio mod and optifine mod were not found
I've installed my mods as all the tutorials said and i've downloaded all the mods on the original pages or in the minecraft forum...
Here is my crash report:
Error Report
[spolier]
Mods loaded: 5
ModLoader 1.2.4
mod_ModLoaderMp 1.2.4v1
mod_MinecraftForge 2.0.0.67
mod_MAtmos_forModLoader r12 for 1.1.x
DrZhark's Mo'Creatures v3.5.0 (MC 1.2.4)
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 821c010a --------
Generated 02-04-12 03:03 PM
Minecraft: Minecraft 1.2.4
OS: Windows 7 (x86) version 6.1
Java: 1.6.0_31, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 4300 Series version 2.1.8787, ATI Technologies Inc.
java.util.FormatFlagsConversionMismatchException: Conversion = s, Flags =
at java.util.Formatter$FormatSpecifier.failMismatch(Unknown Source)
at java.util.Formatter$FormatSpecifier.checkBadFlags(Unknown Source)
at java.util.Formatter$FormatSpecifier.checkGeneral(Unknown Source)
at java.util.Formatter$FormatSpecifier.<init>(Unknown Source)
at java.util.Formatter.parse(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.lang.String.format(Unknown Source)
at adn.a(SourceFile:142)
at cy.a(SourceFile:12)
at ModLoader.initStats(ModLoader.java:933)
at ModLoader.init(ModLoader.java:910)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:79)
at ahu.<clinit>(ahu.java:9)
at net.minecraft.client.Minecraft.a(Minecraft.java:395)
at net.minecraft.client.Minecraft.run(Minecraft.java:732)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT a7649a39 ----------
[/spolier]
Plase solve my problem... and plase send me a private message after your post to know if you soved it
this is my first post so dont be so unkind with me
and i am not english sorry for the bad traduction
Remove from the Method, plus remove the semicolon at the end of it
Get rid of the semicolon in
and add a comma after i, and before int in
heres the link
http://www.minecraftforum.net/topic/886850-error-help/
mod_test
and then:
BlockTest
and so i got the following errors:
I would love it if anyone could help me, i'm new to modding and i really wanna learn!
Thanks! Sadly i got 5 more errors 0_0
yea
BlockTest:
mod_test:
Errors:
== ERRORS FOUND ==
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\mod_GP.java:3: error: mod_GP is not abstract and
does not override abstract method getVersion() in BaseMod
public class mod_GP extends BaseMod
^
And I was wondering what it meant.
The Code (Sorry I don't know how to make a spoiler.
package net.minecraft.src;
public class mod_GP extends BaseMod
{
public static Block Keg = new BlockKeg(190, 0).setHardness(1.0F).setResistance(6.0F).setBlockName("Keg");
public String Version()
{
return "1.0.0";
}
public mod_GP()
{
}
public void load()
{
ModLoader.RegisterBlock(Keg);
Keg.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Keg.png");
ModLoader.AddName(Keg, "Keg");
ModLoader.AddRecipe(new ItemStack(Keg, 1), new Object[] {
"#X#", "#X#", "#X#", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.gunpowder
});
}
}
I added everything required for it to drop more than one item, but it won't. Different items I mean. I edited modloaders Block.JAVA file via eclipse to do so. But what I want to do is render it so that it drops an entity...
Did I help you? There's a little white plus down the bottom. I hope your confused!
i'VE got minecraft cracked (for a test of mods before buying it) and i've got magic launcher
i've installed modloader , modloader MP (cus i've got a server) minecraft forge and optifine (for some mods) and mo'creatures (with all the other usefull mods),MaTmos mod and sign tags mod and i've runed minecraft and all mods worked fine... but when i closed minecraft,and when i started minecaft again, in both starters i get a crash and in the magic launcher's mods list i've got 3 errors in mod loader,24 errors in minecraft forge and the audio mod and optifine mod were not found
I've installed my mods as all the tutorials said and i've downloaded all the mods on the original pages or in the minecraft forum...
Here is my crash report:
Error Report
[spolier] [/spolier]
Plase solve my problem... and plase send me a private message after your post to know if you soved it
this is my first post so dont be so unkind with me
and i am not english sorry for the bad traduction
I am trying to make a staff/wand/item cast lightning wherever the user is aiming their crosshairs.
I have this for the spawning the lightning bolt entity:
What im trying to do is get the users x and y and z coords from the point where the user's crosshairs are. how do i do this?
http://i43.tinypic.com/4t935w.png
(this chairs are blocks)
Check , he calls it a catalyst, but it's exactly what you're talking about!