Cast to splash potion?

Discussion in 'Plugin Development' started by xxNightlordx, Jun 11, 2013.

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

    xxNightlordx

    How do I convert a projectile to a splash potion?

    I tried this:
    Code:
    Potion potion = (Potion) projectile
    But not luck
     
  2. Offline

    InflamedSebi

    pls add more info. What are u trying to do?
    are you listening for an event?
    or just spawning an projectile?

    If u just spawn a potion at the players location:

    Code:java
    1. Location loc = player.getEyeLocation().add(player.getLocation().getDirection().normalize());
    2. ThrownPotion potion= (ThrownPotion) player.getWorld().spawn(loc, ThrownPotion.class);
    3. potion.setShooter(player);
    4. potion.setVelocity(player.getEyeLocation().getDirection().normalize());
    5. // edit the potion effects and so on ...
    6.  
     
Thread Status:
Not open for further replies.

Share This Page