1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Breaking With Specific Tools

Discussion in 'Requests' started by rustedst, May 14, 2020.

  1. rustedst

    rustedst Active Member

    Joined:
    Apr 24, 2020
    Messages:
    97
    Likes Received:
    4
    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?
     
  2. TheMisterWolf

    Supporter +

    Joined:
    Jan 25, 2020
    Messages:
    15
    Likes Received:
    0
    The closest thing to doing this would be this:
    Code (Text):
    1. set {_drops::*} to drops of block with player's tool
    2. {_drops::*} isn't set
    3. 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.
     

Share This Page

Loading...