PotionEffects

Discussion in 'Plugin Development' started by Kilovice, Jun 27, 2014.

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

    Kilovice

    I am trying to give a permanent potion effect per permission. I have this:
    Code:
    if(player.hasPermission("effect.haste")){
                    player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 120000, 1));
    this does give the potion effect, however it gives instead of Haste 1 permanent, Haste 2 permanent.
    Tried this with other potion effects only ones it doesn't effect are Absorption and Health Boost
     
  2. Offline

    THEREDBARON24

    Use integer.Max_Value. This will allow for an everlasting effect.
     
  3. Offline

    Dubehh

    Kilovice
    Code:java
    1. player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 999999, 0));

    0 = power 1
    1 = power 2
    2 = power 3
    etc.
     
  4. Offline

    Kilovice

    Dubehh well I suppose this makes quite a bit more sense haha, thanks! didn't know that's how this works :p
     
Thread Status:
Not open for further replies.

Share This Page