Posted November 24, 201312 yr Hey all, me again. Got a question, I am making a block which when placed destroys the block beneath it. It works fine, I've got it to leave water and lava and things like portals and dragon eggs, but I was wondering, is there a way check the "mining level" of a block. By mining level I mean that obsidian requires a level 3 pick to destroy. I'd rather not have to go program all the id's in because 1. If Minecraft adds more blocks I have to update that code. 2. If someone adds a mod with an indestructible block, well... It won't be indestructible for long. Any help is appreciated!
November 24, 201312 yr From what I understand indestructible blocks generally have a negative hardness, so that's one thing. Aside from that have a look at the net.minecraftforge.common.ForgeHooks class, in particular its canToolHarvestBlock/isToolEffective methods, those should help. You could pass the different tool tiers to check a block's level.
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.