Tool Not Breaking From Loss of Durability

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Tonus_

Member
Oct 9, 2017
4
0
0
20
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.
 

Attachments

  • blockRegen.sk
    2.7 KB · Views: 448
Do if held item's durability is <= 1:
Repair held item by 1
(On mine event)
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:
 
That does not help me at all. If you would look at my current code, you would notice that I do not focus mainly on ores. Please read my previous responses about the situation if you do actually want to help me. Thanks.
Youre remove the tools if they are below duriblaty 1... ?


#Edit:

or use this way:

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

=>

code_language.skript:
naturally break event-block with player's tool
 
That does not help me at all. If you would look at my current code, you would notice that I do not focus mainly on ores. Please read my previous responses about the situation if you do actually want to help me. Thanks.
Basic mechanics are done in my script already.
 
Status
Not open for further replies.