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:
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: