Mining fatigue keeps glitching out

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

Cakerama1

New Member
Aug 21, 2022
8
0
1
I am trying to apply mining fatigue to the player when looking at a specific block to extend how long it takes to break. But it glitches out very easily and sometimes just doesn't work. When you quickly look at the block and look away it doesnt apply mining fatigue and you can break it. Is there any work around, or way to fix this?Any help would be appreciated.





My code:
Code:
on player rotate or move:

    if player's target block is set:

        if distance between player and player's target block < 4.4:

            if target block is mangrove log or mangrove wood:

                apply mining fatigue 2 without any particles whilst hiding the potion icon to player for 1 hour

            else:

                remove mining fatigue from player

    else:

        remove mining fatigue from player

     

on block damage:

    if event-block is mangrove log or mangrove wood:

        apply mining fatigue 2 without any particles whilst hiding the potion icon to player for 1 hour

        if player is not holding diamond axe or netherite axe:

            cancel event
 
Last edited: