Forever Potion Effects?

Discussion in 'Plugin Development' started by jbman223, Jan 12, 2013.

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

    jbman223

    Can you make a potion effect last forever? Thanks.
     
  2. Offline

    LaxWasHere

    Yes, it's possible.
     
  3. Offline

    jbman223

    How would I do it? Set the length to a certain number of ticks? Thanks.
     
  4. Offline

    krazytraynz

    Try setting the level to a number like 10, and see if that works. I know it used to work, but I don't know if it throws an error now or not.
     
  5. Offline

    LaxWasHere

    Code:java
    1.  
    2. if(p.hasPermission("potions.invisible")) {
    3. p.removePotionEffect(PotionEffectType.INVISIBILITY);
    4. p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 18000, 0));
    5. }
    6.  

    18000 is the ticks = 15mins , 0 is the level = 1

    taken from https://github.com/LaxWasHere/Potions
     
    xxCoderForLifexx likes this.
  6. Offline

    chasechocolate

    Or you can make a scheduler that removes then adds a new potion effect every x amount of ticks
     
  7. Offline

    LaxWasHere

    Or just open and close your inventory to get more. Less resource intensive and less complicated.
     
    Tooner101 likes this.
  8. Offline

    mcat95

    Or a scheduler every 20 secs that give you a 20 secs potion effect
     
  9. Offline

    EvilKanoa

    That sounds about right :)
     
Thread Status:
Not open for further replies.

Share This Page