Add potion effect

Discussion in 'Plugin Development' started by Nogtail, Nov 14, 2012.

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

    Nogtail

    So I was wondering (if) and how I could add a potion effect to a player for a time and if I can control the effect level like jumpboost I, jumpboost II
     
    jflory7 likes this.
  2. Offline

    bryce325

    I don't believe you could add a new potion but you could add the effect to an already existing potion.
    Using a playermoveevent checking if he moves up and if he is add some velocity.
    I am sure you can figure out the exact details.
     
  3. Offline

    JazzaG

    Use the addPotionEffect() method within any class implementing LivingEntity.

    Usage:
    Code:
    Player p = event.getPlayer();
    p.addPotionEffect(new PotionEffect(PotionEffectType type, int duration, int amplifier));
    
    JavaDocs
     
  4. Offline

    Heirteir

    TheLexoPlexx
    Why are you reviving a post from 2 years ago?
    int duration is the duration in ticks meaning 20 ticks in 1 second so if you want 5 seconds that would be 100 ticks
     
Thread Status:
Not open for further replies.

Share This Page