Skript Version: Skript v2.4 - beta 9
Minecraft Version: 1.14.4
Addons: Skellet
Hello, I just started using Skript a few hours ago and was working on a (simple?) skript and have hit a wall.
I looked through just about everything I think, and I'm pretty sure I have narrowed down my problem but do not know how to solve it.
The skript works as intended kinda, but if I have back to back carrot on a sticks on my hotbar it will remove the potion effects, until I swap back to the other one. Also noticed on pickup it will not apply a potion effect either. Not entirely sure how to go about fixing it. If anyone could help me out it would be appreciated!!
I have also tried this and it worked better, but it made items that were not a carrot on a stick move up and down (assuming because it was constantly trying to remove a non existent potion effect?).
(Sorry if the fix is obvious just starting out)
Minecraft Version: 1.14.4
Addons: Skellet
Code:
on player held item change:
if held item of player is carrot on a stick:
apply mining fatigue 10 to player for 9999 days
apply haste 5 to player for 9999 days
while held item of player is carrot on a stick:
wait 1 tick
remove mining fatigue from player
remove haste from player
Hello, I just started using Skript a few hours ago and was working on a (simple?) skript and have hit a wall.
I looked through just about everything I think, and I'm pretty sure I have narrowed down my problem but do not know how to solve it.
The skript works as intended kinda, but if I have back to back carrot on a sticks on my hotbar it will remove the potion effects, until I swap back to the other one. Also noticed on pickup it will not apply a potion effect either. Not entirely sure how to go about fixing it. If anyone could help me out it would be appreciated!!
I have also tried this and it worked better, but it made items that were not a carrot on a stick move up and down (assuming because it was constantly trying to remove a non existent potion effect?).
Code:
every second:
loop all players:
if loop-player is holding a carrot on a stick:
set {holding_carrot::%loop-player%} to true
apply mining fatigue 10 to loop-player
apply haste 5 to loop-player
else:
set {holding_carrot::%loop-player%} to false
remove haste from loop-player
remove mining fatigue from loop-player
while {holding_carrot::%loop-player%} is true:
wait 1 tick
(Sorry if the fix is obvious just starting out)