Potion use?

Discussion in 'Plugin Development' started by OllyHal, Jun 25, 2012.

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

    OllyHal

    Hi,

    Just creating a potion cooldown and can't seem to find the class for potion use.

    Any help?

    Thanks
     
  2. You mean LivingEntity.addPotion()?
     
  3. Offline

    OllyHal

    Is that for a player using a potion?
     
  4. a Player is an LivingEnity
     
  5. Offline

    OllyHal

    I can't seem to find this in the api doc :-\
     
  6. Offline

    XbannisherX

    use this:
    Code:
    targetPlayer.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_DIGGING, 10000000, 1));

    targetplayer = YOUR PLAYER
    SLOW_DIGGING = POTION EFFECT
    10000000 = the amount of time, in my case infinite
    1 = the level of the potion , 0 = a lvl 1 potion, 1 = a lvl 2 potion, 2 = a lvl 3 potion
     
  7. Offline

    OllyHal

    no I want to have a cooldown between the use of potions
     
  8. you mean that potions not working for a time, mayby the PotionSplashEvent is something for you?
     
  9. Offline

    OllyHal

    yeah just found that thanks

    Is there one for drinking potions?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  10. try the interact event mayby? I am not sure, because its not instand, or the player eat event?
     
Thread Status:
Not open for further replies.

Share This Page