detecting if player has potion effect

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

wraithcode0

Member
Jul 6, 2025
2
0
1
this code

Code:
every 1 tick:
    loop all players:
        set {_item} to loop-player's tool
        if {_item} is a diamond pickaxe:
            if name of {_item} is "&6&lValor Pickaxe":
                if line 1 of lore of {_item} is "&bUpgraded":
                    if player does not have potion haste:
                        apply haste 2 to loop-player for 9999999 seconds
                else:
                    if player does not have potion haste:
                        apply haste 1 to loop-player for 9999999 seconds
            else:
                remove haste from loop-player
        else:
            remove haste from loop-player


returns these errors:
Code:
[11:23:56+293][Client thread/INFO][Minecraft]: [CHAT] There's no loop that matches 'loop-player does not have potion haste 2' (vpick.sk, line 41: if loop-player does not have potion haste 2:')
[11:23:56+293][Client thread/INFO][Minecraft]: [CHAT] There's no loop that matches 'loop-player does not have potion haste 1' (vpick.sk, line 44: if loop-player does not have potion haste 1:')
[11:23:56+293][Client thread/INFO][Minecraft]: [CHAT] [Skript] Encountered 2 errors while reloading vpick.sk!

ive tried so many different phrasings and nothing seems to work. no sure why it says theres no loop that matches.
 
Code:
every 1 tick:
    loop all players:
        set {_item} to loop-player's tool
        if {_item} is a diamond pickaxe:
            if name of {_item} is "&6&lValor Pickaxe":
                if line 1 of lore of {_item} is "&bUpgraded":
                    apply haste 2 to loop-player for 9999999 seconds replacing the existing effect
                else:
                    apply haste 1 to loop-player for 9999999 seconds replacing the existing effect
            else:
                remove haste from loop-player
        else:
            remove haste from loop-player
 
Code:
every 1 tick:
    loop all players:
        set {_item} to loop-player's tool
        if {_item} is a diamond pickaxe:
            if name of {_item} is "&6&lValor Pickaxe":
                if line 1 of lore of {_item} is "&bUpgraded":
                    apply haste 2 to loop-player for 9999999 seconds replacing the existing effect
                else:
                    apply haste 1 to loop-player for 9999999 seconds replacing the existing effect
            else:
                remove haste from loop-player
        else:
            remove haste from loop-player
I get the same type of error, "There's no loop that matches 'loop-player for 9999999 seconds ...'"
i am using an older version of skript, i believe 2.2dev36 since i am on 1.8. are there any addons that can offer additional control of potions and particles?