Give the player an item that can instantly mine any block

I am working in 1.14 and I'm making an adventure/survival map. Right now I have a pair of shears that I give the player using this command /give @p minecraft:shears{CanDestroy:["minecraft:stone","minecraft:oak_log"]} 1. The problem with this is that the stone and oak_log takes a very long time to mine since shears are not the right tool for mining those blocks. When I give the player haste, this doesn't fix this either. Is there a way for me to give the player an item that acts like it is the right tool to mine a specific type of block (ie: wood, dirt, stone etc)?


Solution 1:

Haste 255 makes you mine slower, because the number wraps around into the negatives. Haste 127 makes you mine the fastest.

There is no item that gives you haste (and the effect.digSpeed attribute modifier apparently doesn't work at all), so you have to use commands to check for holding the item in the main hand. Commands for that are easily found online.

Solution 2:

To allow the player to instantly destroy blocks in survival/adventure mode haste level 127 is best.

/effect give @s haste 30 127 true

In this partiular case, where this effect is bound to an item, a command like this one in a repeating command block is the best solution:

/effect give @a[nbt={SelectedItem:{id:"minecraft:shears"}}] haste 1 127 true