Tutorials Navigation

Tutorials :: New :: Popular :: Top Rated

Tutorials: 18,357 Categories: 12

Total Tutorial Views: 42,395,076

[ 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:

Comments: 6

Views: 9,518

Related Forum: PC Building Forum

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.


  • 5 , do you see that 5 in the for statement? That is how many times it tries to make a vein of this ore in one chunk (veins are groups of the same ore i.e. a vein of three blocks would have 3 diamond ores right next to each other). So the higher the number 5 is, the more it's going to show up.
  • 20 , We're skipping to 20 because the 16s don't matter at all. The 20 is what level the ore can be on. If it's 20 then it would show up from levels 0 , 19. If you didn't want it to start at 0 you would say level to start with + rand.nextInt(how many levels to show up on) (i.e. 20 + rand.nextInt(20); would make the ore show up on levels 20 , 39.
  • oreTitanium.blockID is the block that you want to generate. It's that simple.
  • 3 is how big you want veins to be. WARNING: Veins can't be lower than 3. If you put in 1 or 2 for the vein number, it will not generate.


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: 3.27 by 26 users
Please take one second and rate this tutorial...

Not a Chance
1
2
3
4
5
6
7
8
9
10
Absolutely

Comments

"[ Minecraft ] How To Make A Ore Generate! [ Any I Think ]" :: Login/Create an Account :: 6 comments

If you would like to post a comment please signin to your account or register for an account.

AnthemicsPosted:

Wheeler-Dealers Is This For Xbox?
:3


Nope xbox version does not support mod's and tbh i am not sure it ever will, so this is only for pc.

ConsolePosted:

Even
Console
Even or you guys can look at my thread on this...
http://www.thetechgame.com/Forums/t=2606565/modloader-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. :)

OdinPosted:

Console
Even or you guys can look at my thread on this...
http://www.thetechgame.com/Forums/t=2606565/modloader-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.

yipPosted:

Is This For Xbox?
:3

ConsolePosted:

Even or you guys can look at my thread on this...
http://www.thetechgame.com/Forums/t=2606565/modloader-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.

OdinPosted:

or you guys can look at my thread on this...
http://www.thetechgame.com/Forums/t=2606565/modloader-modding-tutorials-block-food-ore-generation.html

it has way more information on minecraft modding