Posted September 1, 201213 yr I'm having trouble making ores heres my code: package foreverblu.mods.testmod; import java.util.Random; import net.minecraft.src.Block; import net.minecraft.src.CreativeTabs; import net.minecraft.src.ItemStack; import net.minecraft.src.Material; import net.minecraft.src.ModLoader; import net.minecraft.src.World; import net.minecraft.src.WorldGenMinable; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Item; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = "TestMod1", name = "My First Mod!", version = "1") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class TestMod1 { public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int i = 0; i < 50; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(20); int randPosZ = chunkZ + random.nextInt(16); new WorldGenMinable(this.TestOre.blockID, .generate(world, random, randPosX, randPosY, randPosZ); } } private void generateSurface(World world, int chunkX, int chunkZ) { // TODO Auto-generated method stub } public static Block TestOre = new BlockTutorial2(1001, 1).setHardness(5.0F).setStepSound(Block.soundMetalFootstep).setBlockName("TestOre"); @Init public void loadMod1(FMLInitializationEvent event) { GameRegistry.registerBlock(TestOre); LanguageRegistry.instance().addNameForObject(TestOre, "en_US", "TestOre"); MinecraftForge.setBlockHarvestLevel(TestOre, "pickaxe", 4); } public static Block TestBlock = new BlockTutorial(1000, 0).setHardness(2.5F).setStepSound(Block.soundWoodFootstep).setBlockName("TestBlock"); @Init public void loadMod(FMLInitializationEvent event) { GameRegistry.registerBlock(TestBlock); LanguageRegistry.instance().addNameForObject(TestBlock, "en_US", "Woohoo! My first Block "); ModLoader.addRecipe(new ItemStack(TestBlock), new Object[] { "BBB", "BAB", "BBB", Character.valueOf('B'), Block.blockClay, Character.valueOf('A'), Block.obsidian }); } } This is not working out of the code. public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int i = 0; i < 50; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(20); int randPosZ = chunkZ + random.nextInt(16); new WorldGenMinable(this.TestOre.blockID, .generate(world, random, randPosX, randPosY, randPosZ); } } private void generateSurface(World world, int chunkX, int chunkZ) { // TODO Auto-generated method stub } public static Block TestOre = new BlockTutorial2(1001, 1).setHardness(5.0F).setStepSound(Block.soundMetalFootstep).setBlockName("TestOre"); @Init public void loadMod1(FMLInitializationEvent event) { GameRegistry.registerBlock(TestOre); LanguageRegistry.instance().addNameForObject(TestOre, "en_US", "TestOre"); MinecraftForge.setBlockHarvestLevel(TestOre, "pickaxe", 4); } The ores arent spawning..... http://driesgames.game-server.cc//banner.png[/img] Java, Hosting Servers and Videos...
September 1, 201213 yr Look in the wiki, there's a tutorial. Read the EAQ before posting! OR ELSE! This isn't building better software, its trying to grab a place in the commit list of a highly visible github project. www.forgeessentials.com Don't PM me, I don't check this account unless I have to.
September 1, 201213 yr Author ON creating ores? Where? Link pls http://driesgames.game-server.cc//banner.png[/img] Java, Hosting Servers and Videos...
September 4, 201213 yr Author Tried it messed up my mod http://driesgames.game-server.cc//banner.png[/img] Java, Hosting Servers and Videos...
September 4, 201213 yr then you did something wrong, send the code http://i.imgur.com/Hppni.png[/img]
September 16, 201213 yr Well for one the generation code should be in it's own class. Which should be referenced in the main mod file like this: GameRegistry.registerWorldGenerator(new WorldGeneratornamehere()); That's how I make my stuff spawn.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.