| Tutorials Navigation |
|---|
|
|
| [ Minecraft ] How To Make A Ore Generate! [ Any I Think ] |
|---|
|
Tutorial Name: [ Minecraft ] How To Make A Ore Generate! [ Any I Think ] Category: PC Tutorials Submitted By: Console Date Added: Wed. May 09, 2012 Views: 3,380 Share:
Hey Guys Console Here Again With A Tutorial On How To Make Your Own Ore Generate!
Minecraft Version Any I Am Pretty Sure. package net.minecraft.src; public class mod_CamelOre extends BaseMod { public static final Block oreTitanium = new CamelOreBlockOre(123, ModLoader.addOverride("/terrain.png", "/CamelMod/CamelOre/terrain/titaniumore.png")).setHardness(3F).setResistanc e(5F).setStepSound(Block.soundStoneFootstep).setBlockName("oreTitanium" ); public static final Item ingotTitanium = (new CamelOreItem(127)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/CamelMod/CamelOre/gui/items/titaniumingot.png").setItemName("ingotTitanium&q uot;); public mod_CamelOre() { } public void load() { ModLoader.RegisterBlock(oreTitanium); ModLoader.AddName(oreTitanium, "Titanium Ore"); ModLoader.AddName(ingotTitanium, "Titanium Ingot"); } public String getVersion() { return "1.5"; } } What we are going to do is generate our titanium ore. This is the function we have to add to do this: public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ) { for(int l = 0; l < 5; l++) { int i1 = chunkX + rand.nextInt(16); int j1 = rand.nextInt(20); int k1 = chunkZ + rand.nextInt(16); (new WorldGenMinable(oreTitanium.blockID, 3)).generate(world, rand, i1, j1, k1); } } Ok, so let's break this down. First I should make sure you know what a chunk is. A chunk is just any 16x16x128. The 128 is the height.
That's it! You're ore now generates and you can put as many for statements as you want into GenerateSurcface(). Your final mod_CamelOre: package net.minecraft.src;
public class mod_CamelOre extends BaseMod { public static final Block oreTitanium = new CamelOreBlockOre(123, ModLoader.addOverride("/terrain.png", "/CamelMod/CamelOre/terrain/titaniumore.png")).setHardness(3F).setResistanc e(5F).setStepSound(Block.soundStoneFootstep).setBlockName("oreTitanium" ); public static final Item ingotTitanium = (new CamelOreItem(127)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/CamelMod/CamelOre/gui/items/titaniumingot.png").setItemName("ingotTitanium&q uot;); public mod_CamelOre() { } public void load() { ModLoader.RegisterBlock(oreTitanium); ModLoader.AddName(oreTitanium, "Titanium Ore"); ModLoader.AddName(ingotTitanium, "Titanium Ingot"); } public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ) { for(int l = 0; l < 5; l++) { int i1 = chunkX + rand.nextInt(16); int j1 = rand.nextInt(20); int k1 = chunkZ + rand.nextInt(16); (new WorldGenMinable(oreTitanium.blockID, 3)).generate(world, rand, i1, j1, k1); } } public String getVersion() { return "1.0.0"; } } Final Code package net.minecraft.src; public class mod_CamelOre extends BaseMod { public static final Block oreTitanium = new CamelOreBlockOre(123, ModLoader.addOverride("/terrain.png", "/CamelMod/CamelOre/terrain/titaniumore.png")).setHardness(3F).setResistanc e(5F).setStepSound(Block.soundStoneFootstep).setBlockName("oreTitanium" ); public static final Item ingotTitanium = (new CamelOreItem(127)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/CamelMod/CamelOre/gui/items/titaniumingot.png").setItemName("ingotTitanium&q uot;); public mod_CamelOre() { } public void load() { ModLoader.RegisterBlock(oreTitanium); ModLoader.AddName(oreTitanium, "Titanium Ore"); ModLoader.AddName(ingotTitanium, "Titanium Ingot"); } public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ) { for(int l = 0; l < 5; l++) { int i1 = chunkX + rand.nextInt(16); int j1 = rand.nextInt(20); int k1 = chunkZ + rand.nextInt(16); (new WorldGenMinable(oreTitanium.blockID, 3)).generate(world, rand, i1, j1, k1); } } public String getVersion() { return "1.0.0"; } } The Credit For This Tutorial Goes To - Methuselah96 Thanks Guys! Next Tutorial Will Be Great Stay Tuned! |
| Ratings | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Current rating: 2.9 by 20 users
|
|||||||||||||
| Comments | ||
|---|---|---|
|
||

Wheeler-Dealers wrote:
:3
Nope xbox version does not support mod's and tbh i am not sure it ever will, so this is only for pc.
Even wrote:
Console wrote:
Even wrote:
http://www.thetechgame.com/Forums/t=2606565/modload
er-modding-tutorials-block-food-ore-generation.html
it has way more information on minecraft modding
Hey the thing is i am not trying to compete with you i post these so people get help thats cool if you want to help.
Oh ok, had someone steal my tutorials before and post them here so I kinda skeptical when I see a minecraft modding tutorial in the tutorials section.
I would never steal a tutorial from someone if i was to post someones tutorial here i would have asked for permission and if i got permission i would at least gave credit. :)
Console wrote:
Even wrote:
http://www.thetechgame.com/Forums/t=2606565/modload
er-modding-tutorials-block-food-ore-generation.html
it has way more information on minecraft modding
Hey the thing is i am not trying to compete with you i post these so people get help thats cool if you want to help.
Oh ok, had someone steal my tutorials before and post them here so I kinda skeptical when I see a minecraft modding tutorial in the tutorials section.
:3
Even wrote:
http://www.thetechgame.com/Forums/t=2606565/modload
er-modding-tutorials-block-food-ore-generation.html
it has way more information on minecraft modding
Hey the thing is i am not trying to compete with you i post these so people get help thats cool if you want to help.
http://www.thetechgame.com/Forums/t=2606565/modload
er-modding-tutorials-block-food-ore-generation.html
it has way more information on minecraft modding