Posted August 29, 201510 yr Hey i'm relatively new to modding i've been trying to create my own mod, first started on 1.7.10 then i started again for 1.8 but i'm having a small problem with setHarvestLevel with my blocks in that no matter the tool level the block always drops. I've tried various combinations to try solving it including putting the values into the block init but it doesn't seem to work so i figured i should ask some people who know what they are doing,the help is appreciated heres the code that i've used for the items kaijuGoldOre class } package KaijuMod.init; import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class kaijuGoldOre extends Block{ public kaijuGoldOre(Material material){ super(material); this.setHardness(20.0F); this.setHarvestLevel("Pickaxe",5); } ItemRegistry class package KaijuMod.init; import KaijuMod.MainRegistry; import KaijuMod.Reference; import KaijuMod.blocks.BlockKaiju; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class KaijuBlocks { public static Block kaijuGoldOre; public static void init(){ kaijuGoldOre= new KaijuMod.init.kaijuGoldOre(Material.rock).setUnlocalizedName("kaijuGoldOre").setCreativeTab(MainRegistry.tabKaiju); } public static void register(){ GameRegistry.registerBlock(kaijuGoldOre, kaijuGoldOre.getUnlocalizedName().substring(5)); } public static void registerRenders(){ registerRender(kaijuGoldOre); } public static void registerRender(Block block){ Item item =Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5),"inventory")); } }
August 29, 201510 yr Author ok that's got it to work now cheers for the help, now i feel silly for not noticing that sooner
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.