It may be just me, but I do not see any underlined parts of your code. I posted your code into Netbeans and I see what you mean. I am not an expert, but you probably should not have an onUpdate method inside an Item class. onUpdate should be mainly for blocks and entities, the same with the explode method. You should try putting those elsewhere in your code. I would try to make an extension of EntityPlayer called PlayerChecker or something and write boolean methods such as getCanExplode() or isHoldingNitro(), then reference to those in your ItemNitro class or mod_**** class.
Edit: A closer look reveals that the "inventory" "worldObj" "posX" "posY" and "posZ" are the variables not able to be accessed. Probably should try what I said above, but not using these in your ItemNitro class.
I made it work other than the first two words of the explode method (EntityPlayer.worldObj) that still give this error.
Rollback Post to RevisionRollBack
And, no I did not copy Dan200's name because I made my mc account long before I ever knew about modding, not to mention CC.
when i start my gamei get a error and theres no errors when i recomile it so idk what to do....
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 768cd716 --------
Generated 7/27/12 6:55 PM
Minecraft: Minecraft 1.2.5
OS: Windows XP (x86) version 5.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: RADEON XPRESS 200 Series SW TCL x86/MMX/3DNow!/SSE2 version 1.4.5648 WinXP Release, ATI Technologies Inc.
java.lang.NullPointerException
at fr.a(CraftingManager.java:176)
at ClientRegistry.addRecipe(ClientRegistry.java:20)
at cpw.mods.fml.common.registry.FMLRegistry.addRecipe(FMLRegistry.java:41)
at ModLoader.addRecipe(ModLoader.java:179)
at mod_ZimmiteBlock.load(mod_ZimmiteBlock.java:12)
at cpw.mods.fml.common.modloader.ModLoaderModContainer.init(ModLoaderModContainer.java:351)
at cpw.mods.fml.common.Loader.modInit(Loader.java:263)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:604)
at cpw.mods.fml.client.FMLClientHandler.onLoadComplete(FMLClientHandler.java:203)
at net.minecraft.client.Minecraft.a(Minecraft.java:426)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 4d3558a8 ----------
Just a question, but why are you guys still coding for ML? why not forge?
These tutorials are for beginners who are just starting to mod. It gives them the basics on how to do stuff. There is no point in using FML for a few blocks and items. I am probably going to start Forge tutorials for more advanced things, after 1.3 though.
Is it possible to use multiple textures from one .png, and if so, how? I need to know as I have a large sprite sheet of items and blocks I would like to mod in, but it would be tedious for texture pack creators to retexture each image, and even tedious for me to separate them into their own images. Thanks in advance.
You need to use Minecraft Forge. I don't have tutorials on these yet but I will eventually. There are plenty of tutorials on it around already. I suggest using Methuselah's tutorials.
when i start my gamei get a error and theres no errors when i recomile it so idk what to do....
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 768cd716 --------
Generated 7/27/12 6:55 PM
Minecraft: Minecraft 1.2.5
OS: Windows XP (x86) version 5.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: RADEON XPRESS 200 Series SW TCL x86/MMX/3DNow!/SSE2 version 1.4.5648 WinXP Release, ATI Technologies Inc.
java.lang.NullPointerException
at fr.a(CraftingManager.java:176)
at ClientRegistry.addRecipe(ClientRegistry.java:20)
at cpw.mods.fml.common.registry.FMLRegistry.addRecipe(FMLRegistry.java:41)
at ModLoader.addRecipe(ModLoader.java:179)
at mod_ZimmiteBlock.load(mod_ZimmiteBlock.java:12)
at cpw.mods.fml.common.modloader.ModLoaderModContainer.init(ModLoaderModContainer.java:351)
at cpw.mods.fml.common.Loader.modInit(Loader.java:263)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:604)
at cpw.mods.fml.client.FMLClientHandler.onLoadComplete(FMLClientHandler.java:203)
at net.minecraft.client.Minecraft.a(Minecraft.java:426)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 4d3558a8 ----------
You are trying to use something in a recipe which hasn't yet been created. Check for something like this first and if you can't find it post your code in code tags and a spoiler.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
These tutorials are for beginners who are just starting to mod. It gives them the basics on how to do stuff. There is no point in using FML for a few blocks and items. I am probably going to start Forge tutorials for more advanced things, after 1.3 though.
You need to use Minecraft Forge. I don't have tutorials on these yet but I will eventually. There are plenty of tutorials on it around already. I suggest using Methuselah's tutorials.
You are trying to use something in a recipe which hasn't yet been created. Check for something like this first and if you can't find it post your code in code tags and a spoiler.
I have every thing
mod_Zimmite
package net.minecraft.src;
import java.util.Random;
public class mod_Zimmite extends BaseMod
{
public static final Block Zimmite = new BlockZimmite(769, ModLoader.addOverride("/terrain.png", "/zimmy.png")).setHardness(15F).setResistance(200F).setStepSound(Block.soundStoneFootstep).setBlockName("Zimmite"); // It's recommended to have non-screen names starting with a lower case character just for preference
public void load()
{
}
public mod_Zimmite()
{
ModLoader.registerBlock(Zimmite);
ModLoader.addName(Zimmite, "Zimmite Ore");
ModLoader.addSmelting(Block.planks.blockID, new ItemStack(Zimmite, 1));
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(20);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Zimmite.blockID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.2.5";
}
}
BlockZimmite
package net.minecraft.src;
import java.util.Random;
public class BlockZimmite extends Block
{
public BlockZimmite(int i, int j)
{
super(i, j, Material.rock);
}
public int quantityDropped(Random random)
{
return 1;
}
public int idDropped(int i, Random random, int j)
{
return mod_Zimmite.Zimmite.blockID;
}
}
mod_ItemZimmiteingot
package net.minecraft.src;
public class mod_ItemZimmiteingot extends BaseMod
{
public static final Item Zimmiteingot = new ItemZimmiteingot(770).setItemName("Zimmiteingot");
public void load()
{
Zimmiteingot.iconIndex = ModLoader.addOverride("/gui/items.png", "zimmiteingot.png");
ModLoader.addName(Zimmiteingot, "Zimmite Ingot");
ModLoader.addSmelting(mod_Zimmite.Zimmite.blockID, new ItemStack(Zimmiteingot, 1));
}
public String getVersion()
{
return "1.2.5";
}
}
ItemZimmiteingot
package net.minecraft.src;
public class ItemZimmiteingot extends Item
{
public ItemZimmiteingot(int i)
{
super(i);
maxStackSize = 64;
}
}
mod_ZimmiteBlock
package net.minecraft.src;
public class mod_ZimmiteBlock extends BaseMod
{
public static final Block ZimmiteBlock = new BlockZimmiteBlock(771, 0).setBlockName("ZimmiteBlock").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
ZimmiteBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/zimmiteblock.png");
ModLoader.registerBlock(ZimmiteBlock);
ModLoader.addName(ZimmiteBlock, "Zimmite Block");
ModLoader.addRecipe(new ItemStack(ZimmiteBlock, 1), new Object []
{"###", "###", "###", Character.valueOf('#'), mod_ItemZimmiteingot.Zimmiteingot.shiftedIndex});
}
public String getVersion()
{
return "1.2.5";
}
}
BlockZimmiteBlock
package net.minecraft.src;
import java.util.Random;
public class BlockZimmiteBlock extends Block
{
public BlockZimmiteBlock(int i, int j)
{
super(i, j, Material.rock);
}
public int quantityDropped(Random random)
{
return 1;
}
public int idDropped(int i, Random random, int j)
{
return mod_ZimmiteBlock.ZimmiteBlock.blockID;
}
}
This code is all you need. Materials are in EnumToolMaterial, this one is just telling you, what are swords doing and its working perfectly. You dont have to fill something in it.
Whew! Thanks! I was really confused for a sec, I just tried closing things and idk, just winded up making it work Everything's all cool now
package net.minecraft.src;
import java.util.Random;
public class mod_Zimmite extends BaseMod
{
public static final Block Zimmite = new BlockZimmite(769, ModLoader.addOverride("/terrain.png", "/zimmy.png")).setHardness(15F).setResistance(200F).setStepSound(Block.soundStoneFootstep).setBlockName("Zimmite"); // It's recommended to have non-screen names starting with a lower case character just for preference
public void load()
{
}
public mod_Zimmite()
{
ModLoader.registerBlock(Zimmite);
ModLoader.addName(Zimmite, "Zimmite Ore");
ModLoader.addSmelting(Block.planks.blockID, new ItemStack(Zimmite, 1));
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(20);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Zimmite.blockID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.2.5";
}
}
BlockZimmite
package net.minecraft.src;
import java.util.Random;
public class BlockZimmite extends Block
{
public BlockZimmite(int i, int j)
{
super(i, j, Material.rock);
}
public int quantityDropped(Random random)
{
return 1;
}
public int idDropped(int i, Random random, int j)
{
return mod_Zimmite.Zimmite.blockID;
}
}
mod_ItemZimmiteingot
package net.minecraft.src;
public class mod_ItemZimmiteingot extends BaseMod
{
public static final Item Zimmiteingot = new ItemZimmiteingot(770).setItemName("Zimmiteingot");
public void load()
{
Zimmiteingot.iconIndex = ModLoader.addOverride("/gui/items.png", "zimmiteingot.png");
ModLoader.addName(Zimmiteingot, "Zimmite Ingot");
ModLoader.addSmelting(mod_Zimmite.Zimmite.blockID, new ItemStack(Zimmiteingot, 1));
}
public String getVersion()
{
return "1.2.5";
}
}
ItemZimmiteingot
package net.minecraft.src;
public class ItemZimmiteingot extends Item
{
public ItemZimmiteingot(int i)
{
super(i);
maxStackSize = 64;
}
}
mod_ZimmiteBlock
package net.minecraft.src;
public class mod_ZimmiteBlock extends BaseMod
{
public static final Block ZimmiteBlock = new BlockZimmiteBlock(771, 0).setBlockName("ZimmiteBlock").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
ZimmiteBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/zimmiteblock.png");
ModLoader.registerBlock(ZimmiteBlock);
ModLoader.addName(ZimmiteBlock, "Zimmite Block");
ModLoader.addRecipe(new ItemStack(ZimmiteBlock, 1), new Object []
{"###", "###", "###", Character.valueOf('#'), mod_ItemZimmiteingot.Zimmiteingot.shiftedIndex});
}
public String getVersion()
{
return "1.2.5";
}
}
BlockZimmiteBlock
package net.minecraft.src;
import java.util.Random;
public class BlockZimmiteBlock extends Block
{
public BlockZimmiteBlock(int i, int j)
{
super(i, j, Material.rock);
}
public int quantityDropped(Random random)
{
return 1;
}
public int idDropped(int i, Random random, int j)
{
return mod_ZimmiteBlock.ZimmiteBlock.blockID;
}
}
Merge your mod_ classes into one. Then you won't have a problem.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Why does my Minecraft crash when I make a stair block?
Here is my code:
The mod_MoreBlocks
package net.minecraft.src;
public class mod_Blocks extends BaseMod
{
public static final Block DiamondStairs = new BlockDiamondStairs(125, 0).setBlockName("DiamondStairs").setHardness(5F).setResistance(10F).setStepSound(Block.soundMetalFootstep);
public void load()
{
DiamondStairs.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/moreblocks/diamondblock.png");
ModLoader.registerBlock(DiamondStairs);
ModLoader.addName(DiamondStairs, "Diamond Stairs");
ModLoader.addRecipe(new ItemStack(DiamondStairs, 1), new Object [] {"# ", "## ", "###", Character.valueOf('#'), Item.diamond});
}
public String getVersion()
{
return "More Blocks, by MinecraftTheGuys [1.2.5]";
}
}
The Block:
package net.minecraft.src;
import java.util.ArrayList;
public class BlockDiamondStairs extends Block
{
public BlockDiamondStairs(int i, int j)
{
super(i, j, Material.rock);
}
public void getCollidingBoundingBoxes(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist)
{
int l = world.getBlockMetadata(i, j, k);
if (l == 0)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
} else if (l == 1)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
} else if (l == 2)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
} else if (l == 3)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
}
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
int l = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if (l == 0)
{
world.setBlockMetadataWithNotify(i, j, k, 2);
} if (l == 1)
{
world.setBlockMetadataWithNotify(i, j, k, 1);
} if (l == 2)
{
world.setBlockMetadataWithNotify(i, j, k, 3);
} if (l == 3)
{
world.setBlockMetadataWithNotify(i, j, k, 0);
}
}
public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k)
{ setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
} public boolean isOpaqueCube()
{ return false;
} public boolean renderAsNormalBlock()
{ return false;
} public int getRenderType()
{
return 10;
}
}
The error:
Why does my Minecraft crash when I make a stair block?
Here is my code:
The mod_MoreBlocks
package net.minecraft.src;
public class mod_Blocks extends BaseMod
{
public static final Block DiamondStairs = new BlockDiamondStairs(125, 0).setBlockName("DiamondStairs").setHardness(5F).setResistance(10F).setStepSound(Block.soundMetalFootstep);
public void load()
{
DiamondStairs.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/moreblocks/diamondblock.png");
ModLoader.registerBlock(DiamondStairs);
ModLoader.addName(DiamondStairs, "Diamond Stairs");
ModLoader.addRecipe(new ItemStack(DiamondStairs, 1), new Object [] {"# ", "## ", "###", Character.valueOf('#'), Item.diamond});
}
public String getVersion()
{
return "More Blocks, by MinecraftTheGuys [1.2.5]";
}
}
The Block:
package net.minecraft.src;
import java.util.ArrayList;
public class BlockDiamondStairs extends Block
{
public BlockDiamondStairs(int i, int j)
{
super(i, j, Material.rock);
}
public void getCollidingBoundingBoxes(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist)
{
int l = world.getBlockMetadata(i, j, k);
if (l == 0)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
} else if (l == 1)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
} else if (l == 2)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
} else if (l == 3)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist);
}
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
int l = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if (l == 0)
{
world.setBlockMetadataWithNotify(i, j, k, 2);
} if (l == 1)
{
world.setBlockMetadataWithNotify(i, j, k, 1);
} if (l == 2)
{
world.setBlockMetadataWithNotify(i, j, k, 3);
} if (l == 3)
{
world.setBlockMetadataWithNotify(i, j, k, 0);
}
}
public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k)
{ setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
} public boolean isOpaqueCube()
{ return false;
} public boolean renderAsNormalBlock()
{ return false;
} public int getRenderType()
{
return 10;
}
}
The error:
java.lang.StringIndexOutOfBoundsException: String index out of range: 8
at java.lang.String.charAt(Unknown Source)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:394)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:412)
at net.minecraft.src.mod_Blocks.load(mod_Blocks.java:12)
at net.minecraft.src.ModLoader.init(ModLoader.java:856)
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(Unknown Source)
Thanks for this! Gonna make a random ore mod now! Other tutorials are like "ok.. *yawn* now.. umm.. yoou wanna write that in..*yawn* and you get a block...." But you explain everything perfectly! Thanks
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Thank you so much for this!
I thought to myself before i found this: Ill never know how to mod..
Then I found this and I have made led ore, a led block, and a smelting recipe to make a led ingot! Thank you so much!!
im trying to animate my block but when i animate it all blocks that are the same as it have there animations go off with out me even clicking on them how do i fix this
Awesome information in here, but one quick question: do entity bounding boxes rotate with their entities, or is there some complex code required to make that happen?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I made it work other than the first two words of the explode method (EntityPlayer.worldObj) that still give this error.
These tutorials are for beginners who are just starting to mod. It gives them the basics on how to do stuff. There is no point in using FML for a few blocks and items. I am probably going to start Forge tutorials for more advanced things, after 1.3 though.
You need to use Minecraft Forge. I don't have tutorials on these yet but I will eventually. There are plenty of tutorials on it around already. I suggest using Methuselah's tutorials.
You are trying to use something in a recipe which hasn't yet been created. Check for something like this first and if you can't find it post your code in code tags and a spoiler.
together they are powerful beyond imagination."
I have every thing
mod_Zimmite
package net.minecraft.src; import java.util.Random; public class mod_Zimmite extends BaseMod { public static final Block Zimmite = new BlockZimmite(769, ModLoader.addOverride("/terrain.png", "/zimmy.png")).setHardness(15F).setResistance(200F).setStepSound(Block.soundStoneFootstep).setBlockName("Zimmite"); // It's recommended to have non-screen names starting with a lower case character just for preference public void load() { } public mod_Zimmite() { ModLoader.registerBlock(Zimmite); ModLoader.addName(Zimmite, "Zimmite Ore"); ModLoader.addSmelting(Block.planks.blockID, new ItemStack(Zimmite, 1)); } public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int i = 0; i < 7; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(20); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(Zimmite.blockID, 8)).generate(world, random, randPosX, randPosY, randPosZ); } } public String getVersion() { return "1.2.5"; } }BlockZimmite
package net.minecraft.src; import java.util.Random; public class BlockZimmite extends Block { public BlockZimmite(int i, int j) { super(i, j, Material.rock); } public int quantityDropped(Random random) { return 1; } public int idDropped(int i, Random random, int j) { return mod_Zimmite.Zimmite.blockID; } }mod_ItemZimmiteingot
package net.minecraft.src; public class mod_ItemZimmiteingot extends BaseMod { public static final Item Zimmiteingot = new ItemZimmiteingot(770).setItemName("Zimmiteingot"); public void load() { Zimmiteingot.iconIndex = ModLoader.addOverride("/gui/items.png", "zimmiteingot.png"); ModLoader.addName(Zimmiteingot, "Zimmite Ingot"); ModLoader.addSmelting(mod_Zimmite.Zimmite.blockID, new ItemStack(Zimmiteingot, 1)); } public String getVersion() { return "1.2.5"; } }ItemZimmiteingot
package net.minecraft.src; public class ItemZimmiteingot extends Item { public ItemZimmiteingot(int i) { super(i); maxStackSize = 64; } }mod_ZimmiteBlock
package net.minecraft.src; public class mod_ZimmiteBlock extends BaseMod { public static final Block ZimmiteBlock = new BlockZimmiteBlock(771, 0).setBlockName("ZimmiteBlock").setHardness(3F).setResistance(4F).setLightValue(1F); public void load() { ZimmiteBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/zimmiteblock.png"); ModLoader.registerBlock(ZimmiteBlock); ModLoader.addName(ZimmiteBlock, "Zimmite Block"); ModLoader.addRecipe(new ItemStack(ZimmiteBlock, 1), new Object [] {"###", "###", "###", Character.valueOf('#'), mod_ItemZimmiteingot.Zimmiteingot.shiftedIndex}); } public String getVersion() { return "1.2.5"; } }BlockZimmiteBlock
package net.minecraft.src; import java.util.Random; public class BlockZimmiteBlock extends Block { public BlockZimmiteBlock(int i, int j) { super(i, j, Material.rock); } public int quantityDropped(Random random) { return 1; } public int idDropped(int i, Random random, int j) { return mod_ZimmiteBlock.ZimmiteBlock.blockID; } }Whew! Thanks! I was really confused for a sec, I just tried closing things and idk, just winded up making it work
Merge your mod_ classes into one. Then you won't have a problem.
together they are powerful beyond imagination."
I dont know how i try once but failed
Yes, eventually.
There is a tutorial on the bottom of the OP.
together they are powerful beyond imagination."
does it recompile properly?
Create an explosion in the world at the players position.
together they are powerful beyond imagination."
one problem... "worldObj cannot be resolved"
EDIT: i messed around and
Entity entity; World.createExplosion(entity, ModLoader.getMinecraftInstance().thePlayer.posX, ModLoader.getMinecraftInstance().thePlayer.posY, ModLoader.getMinecraftInstance().thePlayer.posZ, 3F);but now i have the same error I had before:
"Cannot make a static reference to the non-static method createExplosion"
I thought to myself before i found this: Ill never know how to mod..
Then I found this and I have made led ore, a led block, and a smelting recipe to make a led ingot! Thank you so much!!
nope lol