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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Tool Not Breaking From Loss of Durability

Discussion in 'Skript' started by Tonus_, Oct 9, 2017.

Thread Status:
Not open for further replies.
  1. Tonus_

    Tonus_ Member

    Joined:
    Oct 9, 2017
    Messages:
    4
    Likes Received:
    0
    I'm trying to make a block regeneration script and because I use cancel event to not break the block, I needed to add a way for the tool to take durability from breaking it. However, the tool would go into the negatives and would never break. I tried adding an if statement checking if the tool's durability is less than 0, but nothing would happen. Could someone please help me? I'll have the script as a download. The reason why I choose doing this than download the BlockRegen plugin is because this also acts as my would guard as if the player tries to break a block, it will cancel the event.
     

    Attached Files:

  2. MCProHost

    MCProHost Active Member

    Joined:
    Sep 17, 2017
    Messages:
    80
    Likes Received:
    0
    Do if held item's durability is <= 1:
    Repair held item by 1
    (On mine event)
     
  3. Tonus_

    Tonus_ Member

    Joined:
    Oct 9, 2017
    Messages:
    4
    Likes Received:
    0
    Either the code you sent me does not work, or I'm really stupid. Also, I have multiple mine events. It would be best if you sent me a version of the skript that actually does it. Keep in mind that I only want the player's tool to only be damaged if it is breaking a block that drops something, not for any block because I have an event checking for any block being broke to then cancel the event with nothing else happening.
    Hopefully that made sense. :emoji_stuck_out_tongue:
     
    • Funny Funny x 1
  4. Epicskymi

    Epicskymi Active Member

    Joined:
    Feb 14, 2017
    Messages:
    71
    Likes Received:
    11
    it would if this was requests
     
    • Agree Agree x 1
  5. MCProHost

    MCProHost Active Member

    Joined:
    Sep 17, 2017
    Messages:
    80
    Likes Received:
    0
    I'll help you when I'm homw
     
  6. Tonus_

    Tonus_ Member

    Joined:
    Oct 9, 2017
    Messages:
    4
    Likes Received:
    0
    I still need help.
     
  7. glowgrew

    glowgrew Active Member

    Joined:
    Jan 26, 2017
    Messages:
    99
    Likes Received:
    7
  8. Tonus_

    Tonus_ Member

    Joined:
    Oct 9, 2017
    Messages:
    4
    Likes Received:
    0
  9. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    59
    Youre remove the tools if they are below duriblaty 1... ?


    #Edit:

    or use this way:

    [skellett] [naturally] break %block% [naturally] [(with|using) %-itemstack%]

    =>

    Code (Skript):
    1. naturally break event-block with player's tool
     
  10. glowgrew

    glowgrew Active Member

    Joined:
    Jan 26, 2017
    Messages:
    99
    Likes Received:
    7
    Basic mechanics are done in my script already.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...