Breaking With Specific Tools

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

rustedst

Active Member
Apr 24, 2020
97
4
8
22
Istanbul, Turkey
Can anyone help me writing a script that prevents players from breaking blocks without tools? Players should be able to break dirt block only while holding a shovel, stone block only while holding a pickaxe, and so on. Is it possible without typing every block one by one?
 
The closest thing to doing this would be this:
Code:
set {_drops::*} to drops of block with player's tool
{_drops::*} isn't set
cancel event
The only issues with this is that if you mine a block (like dirt) where although shovel is the correct tool you can use any tool it wont cancel and if you mine a block like glass where it doesn't drop anything with any tool (unless it has silk touch) it will always cancel the event.