1. 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!


    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting the level of a potion effect

Discussion in 'Skript' started by TawnyFrogmouth, May 4, 2017.

Thread Status:
Not open for further replies.
  1. T

    Apr 4, 2017
    Likes Received:
    I know I can check whether a player has a certain potion effect with a condition like

    Code (Text):
    1. player has resistance
    Is it possible to determine the level of a potion effect currently affecting a player?

    What I'm aiming for here is the following: I want to apply a potion effect to a player periodically:
    Code (Text):
    1. remove resistance from loop-player
    2. apply resistance 2 to loop-player for 12 seconds
    However, I'd like to skip this code if the player already has a higher level of resistance. Is this possible?
  2. Gladrian

    Gladrian Member

    Feb 20, 2017
    Likes Received:
    Looks like you can do it with SkMorkaz:

    Potion Tier
    Addon: SkMorkaz
    [mor.]potion tier [of] %string% of (%player%|%entity%)
    Returns tier number of specific potion if it is applied to specific player. If not, it returns 0.
    Please use Bukkit potion names in text, like as in example.

    Version 0.2+ Supports getting tier of potion from entities and players.
    set {_tier.number} to potion tier of "SLOW" of player

  3. Snow-Pyon

    Moderator Resource Staff

    Jan 25, 2017
    Likes Received:
    With QuarSK:
    Code (Skript):
    1. loop active potion effects of player:,
    2.     if potion type of loop-potion effect is resistance:
    3.         if tier of loop-potion effect is less than 3:
    4.             #do stuff
Thread Status:
Not open for further replies.
  • About Us

    Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.
  • Support skUnity

    The staff team works very hard to make sure the community is running its best. This means constantly performing upgrades to systems and other features. This does cost a bit of money to keep doing. Donating to skUnity would allow the server to keep running smoothly for years to come!

    Support Us!
  • Join our Discord

    Discord is an all-in-one voice and text chat for gamers that’s free, secure, and works on both your desktop and phone.