player tools won't break when durability is 0

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

    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.

Trickered

New Member
Feb 1, 2022
6
0
1
Skript version: git-Paper-175
Author: Trickered
Minecraft version: 1.18.1

Code:
Code:
function overdrill(b: block, player: player):
    break targeted block of {_player} using {_player}'s tool
    loop blocks in radius 1.75 around {_b}:
        if loop-block is bedrock, barrier, end portal frame, nether portal, end portal or end gateway:
            send "<##00aeef>&lEmzenCore: &cThere is unbreakable Blocks in your way!!" to {_player}
            stop
        break loop-block using {_player}'s tool
        damage tool of {_player} by 1

on break:
    if player is holding pickaxe:
        if "%lore of player's tool%" contains "overdrill":
            overdrill(event-block, player)
        else:
            stop
    else:
        stop

no error at all

i was trying to make a special tool that make players life easier but there is a issue when the tool durability is 0 they still can use it, its seem to be unbreakable

have you tried searching docs? : yes
have you tried searching forums? : yes
i really can't think about other way to make it work
 
Status
Not open for further replies.