KageOniMC Posted April 22, 2013 Posted April 22, 2013 I've recently started using Forge for 1.5.1 and have found several changes when creating simple classes. I cannot understand why my block is not added in to the creatives tabs and cannot be spawn in via commands. Would appreciate any help you can offer. http://paste.minecraftforge.net/view/568f5e32 and the block class. http://paste.minecraftforge.net/view/812a5f9a I hope someone can help me with my issue. -KageOniMC Quote
KageOniMC Posted April 22, 2013 Author Posted April 22, 2013 I've recently started using Forge for 1.5.1 and have found several changes when creating simple classes. I cannot understand why my block is not added in to the creatives tabs and cannot be spawn in via commands. Would appreciate any help you can offer. http://paste.minecraftforge.net/view/568f5e32 and the block class. http://paste.minecraftforge.net/view/812a5f9a I hope someone can help me with my issue. -KageOniMC Quote
saxon564 Posted April 22, 2013 Posted April 22, 2013 you block class has to be like this: public class Mithrilore extends Block { private String texturePath; public Mithrilore(int par1, Material par2Material, String par3String) { super(par1, par2Material); this.setCreativeTab(CreativeTabs.tabBlock); this.texturePath = par3String; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister){ this.blockIcon = par1IconRegister.registerIcon("ElixirCraft/" + this.texturePath); } } the main method of this class is how the block gets added to the game and the creative menu, without it the game will know its there but will not appear. also in the main class the declaration for the block should look like this: public static Block Blockmithrilore = new Mithrilore(1000, Material.rock,).setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Blockmithrilore"); Quote
saxon564 Posted April 22, 2013 Posted April 22, 2013 you block class has to be like this: public class Mithrilore extends Block { private String texturePath; public Mithrilore(int par1, Material par2Material, String par3String) { super(par1, par2Material); this.setCreativeTab(CreativeTabs.tabBlock); this.texturePath = par3String; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister){ this.blockIcon = par1IconRegister.registerIcon("ElixirCraft/" + this.texturePath); } } the main method of this class is how the block gets added to the game and the creative menu, without it the game will know its there but will not appear. also in the main class the declaration for the block should look like this: public static Block Blockmithrilore = new Mithrilore(1000, Material.rock,).setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Blockmithrilore"); Quote
Recommended Posts
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.