Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[UNSOLVED][1.7.10] Better Version of Is Tool Effective?


Recommended Posts

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.

Link to comment
Share on other sites

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)


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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.