Posted April 27, 20169 yr So I've been using this sort of code for my 3 by 3 by 3 pickaxe if(world.getBlock(x, y, z) == world.getBlock(x+1, y, z) && world.getBlock(x+1, y, z).isToolEffective("pickaxe", 3)) .isToolEffective("pickaxe", 3) isn't really working well for me, since I'd like it to mine Obsidian, Fences, Stairs, and everything that is mined faster with a diamond pickaxe. For redstone ore, I've currently been using an awkward boolean system, but it's under control. I don't want to code a awkward fix for all of these other blocks either.
April 27, 20169 yr You are checking world.getBlock(x, y, z).isToolEffective("pickaxe", 3) , right? If so, then world.getBlock(x+1, y, z).isToolEffective("pickaxe", 3) is redundant, as you also check that world.getBlock(x, y, z) and world.getBlock(x+1, y, z) are the same block (and if the pickaxe is effective against the block it is effective against the block).
April 27, 20169 yr Author Lmao, I thought that thru already. Meh, I like it like that... Lmao what if there's a block that is only affected by pickaxes if the damage is 1 or something... heh... That also reminds me to add a damage checker.
April 28, 20169 yr I was not quite sure what you were asking. To be honest I am still not 100%, but do you want ItemPickaxe#canHarvestBlock(IBlockState) ?
April 28, 20169 yr Author Pretty much, except instead of ItemPickaxe I want Block, and CanHarvestBlock makes it so that I can basically harvest anything... So let me try to explain this much more clearly... I would like to know a way I can check if the block is broken faster by a diamond pickaxe (Level 3 Pickaxe). I was currently using getBlock().isToolEffective("pickaxe", 3) (From memory), but it doesn't work for stairs, obsidian, end_stone, etc.
April 29, 20169 yr ItemPickaxe should have a method in it which works fine. After all, the pickaxe can harvest the stone just fine.
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.