Posted June 23, 201312 yr I am a new modder trying to get comfortable with the absolute Forge basics, and I was following some tutorials on how to create a new block, but I encountered two problems while doing so. 1: When i try to use the setBlockName(string) method in my mods main class, Eclipse tells me the method is undefined for the type "Block", while it works fine in the tutorial. This is my code: @Init public void load(FMLInitializationEvent event) { proxy.registerRenderers(); blockRF = (new RFBlock(538, 0)).setBlockName("nonReadableRFBlockName"); LanguageRegistry.addName(blockRF, "Rotten Flesh Block"); MinecraftForge.setBlockHarvestLevel(blockRF, "pickaxe", 1); GameRegistry.registerBlock(blockRF, "internalRFBlock"); 2: The tutorial tells me to add the line "super(par1, par2, Material.rock);" to my block class. However, Eclipse tells me the constructor is undefined, and recommends me to delete the par2 variable. My code: public RFBlock(int par1, int par2){ super(par1, Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); this.setHardness(5.6F); this.setResistance(56.34F); this.setStepSound(this.soundStoneFootstep); } My tutorial link: http://www.minecraftforge.net/wiki/Your_first_block
June 23, 201312 yr The Tutorial you're following is outdated. Replace setBlockName with setUnlocalizedName. Regarding the Block constructor, parameter 1 resembles the block's index within the block list while the second provides the Block Material to use. It used to be the texture index of the block, but since that is now managed with Icons, it has been removed. Couldn't find a better tutorial for you and the forge wiki really takes awefully long to load. Sorry.
June 23, 201312 yr Author Well, that's useful information. I will look for a better tutorial then. "Thank you" given!
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.