Jump to content

Recommended Posts

Posted

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

 

Posted

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

 

Posted

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");

 

Posted

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");

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.