Create a sprite object and set initial visibility to invisible (but during debugging set it to visible). Pin this object to player hands. Then create a variable and give it a name say mineAmount. Your tools ‘mining amount’ that the player equips will overwrite this variable mineAmount.
Next disable that sprite object collision and each time you click (playing the mine animation) that sprite objects collisions are enabled and later disabled. On this sprite object collides with tree or rock subtract that amount from tree or rock variable and or add to amount of resources your player collected.