PotionSplashEvent -- how do I know what type of potion it is?

Discussion in 'Plugin Development' started by AbeJ, Jan 25, 2012.

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

    AbeJ

    I want to make mundane splash potions explode when they hit the ground, but I can't figure it out.
    Is there a way to know what the potion's type is?
     
  2. Offline

    DrBowe

  3. Offline

    AbeJ

  4. Offline

    DrBowe

    AbeJ
    Yeah. That seems very...silly. I can't imagine them excluding the ability to easily grab the type from the event, unless there is no easy way to get the type of a thrown potion. Still, the data has to be there somewhere, otherwise the server wouldn't know what effects to place on players whenever the potion impacts an area.

    Zeerix
    Tagging you since you made the bleeding commit for this. Any insight?
     
  5. Offline

    Zeerix

    There's another API developed (here: PotionsAPI branch) which allows to call getEffects() on a ThrownPotion to receive all effects. I don't know why it's not in the current RB, I guess it's not fully done.

    Currently, the only way is to cast the ThrownPotion to a CraftThrownPotion and use its methods to get the damage value of the original potion.
     
    tehbeard likes this.
  6. Offline

    AbeJ

    Alright, thanks.
     
Thread Status:
Not open for further replies.

Share This Page