[Answered] New block making help
2 posters
MC Modding :: Help :: Help
Page 1 of 1
[Answered] New block making help
I have followed several tutorials to a T and cannot find one that actually works. I don't know why this is, because when I run it there are no errors or problems, and minecraft doesn't crash. But when I try to generate it or do the recipe I made for it... nothing. Also, any help on showing me how to "draw" the blocks. thanks-Jess
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Re: [Answered] New block making help
to add recipes you need to do
to get the texture go into the Blockemeraldgem or emeraldgem which ever you have name it you then go to the part that says or if you haven't do so
to generate the ore put this code I will show an example cause this can get confusing
and the example
- Code:
ModLoader.AddRecipe(new ItemStack(mod_grinder.grinder, 10), new Object[] {
"PPP", Character.valueOf('P'), Block.grass
});
to get the texture go into the Blockemeraldgem or emeraldgem which ever you have name it you then go to the part that says or if you haven't do so
- Code:
namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/spritefilename/spritenamehere.png");
to generate the ore put this code I will show an example cause this can get confusing
- Code:
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < RARITY; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(HEIGHT ABOVE BEDROCK);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Namehere.Namehere.blockID, VEIN SIZE)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
and the example
- Code:
package net.minecraft.src;
import java.util.Random;
public class mod_namehere extends BaseMod
{
public static Block namehere = new namehere(ID, 0).setHardness(3.0F).setResistance(150.0F).setLightValue(1.0F).setBlockName("emerald");
public mod_namehere() {
ModLoader.RegisterBlock(namehere);
ModLoader.AddName(namehere, "namehere");
namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/spritefile/spritenamehere.png");
ModLoader.AddRecipe(new ItemStack(namehere, 2), new Object[] {
"r", Character.valueOf('r'), Item.appleGold
});
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < how rare coal is 20; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(HEIGHTABOVEBEDROCK);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_namehere.namehere.blockID, VEINSIZEMAX)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public String Version()
{
return "1.8.1";
}
}
Re: [Answered] New block making help
thank you so much for the help! worked right away!
jesshankin22- Member
- Posts : 47
Join date : 2011-10-24
Similar topics
» Making a Furnace-like Block
» [Answered/Solved] Making custom mobs fly
» [Answered]How To Create a Block Animation
» [Unanswered] Making New Minecraft Dimension
» How Do I Add A Block For 1.2.5
» [Answered/Solved] Making custom mobs fly
» [Answered]How To Create a Block Animation
» [Unanswered] Making New Minecraft Dimension
» How Do I Add A Block For 1.2.5
MC Modding :: Help :: Help
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum