Posted February 1, 201411 yr I've just begun updating my mod, and have found that setBlockHarvestLevel and setToolClass functions have moved, but no idea where they moved to. Anybody know?
February 2, 201411 yr Apparently you have to override it in your block class: https://github.com/MinecraftForge/MinecraftForge/blob/master/src/main/java/net/minecraftforge/common/ForgeHooks.java Line 99 -> method canToolHarvestBlock(Block block, int metadata, ItemStack stack) You can see that block#getHarvestTool(metadata) & block.getHarvestLevel(metadata) are getting called. From that I can conclude you have to override it As for setting a custom tool class, I couldnt find it as quickly as this. (I spent 5 minutes ) I am fairly new to Java and modding, so my answers are not always 100% correct. Sorry for that!
February 2, 201411 yr Author Um, that wasn't what I was going for, but never mind, as I is dumb, and have found the problem.
February 2, 201411 yr Um, that wasn't what I was going for, but never mind, as I is dumb, and have found the problem. so how did you fix it? Only code when your having fun doing it.
February 2, 201411 yr Author Vanilla Minecraft comes with the command, so you just use: exampleBlock.setHardnessLevel("pickaxe", 2); For the setToolClass, I still have no idea, but I was just worried about the harvest level, which you establish when you set the tool material.
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.