ProjectileHitEvent

Discussion in 'Plugin Development' started by ThatBox, Jun 13, 2012.

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

    ThatBox

    How do i find out what the projectile hits ?

    I checked the JavaDocs but I can't seem to find a way.
     
  2. Offline

    CorrieKay

    look in the entity damage events, they'll have a projectile for a damage cause.
     
    ThatBox likes this.
  3. Offline

    ThatBox

    Do egg hits cause damage ? o.o
     
  4. Offline

    CorrieKay

    im not sure. First guess would be that, since eggs and snowballs deal no damage, they dont throw an entity damage event, However, if you look closely, the mobs turn red if you hit them... so my guess is it DOES throw an entity damage event, but the damage is zero (which would allow you to modify it and have them deal damage)

    So if you want to fire on arrows, your best bet is doing

    if(event.getDamage()>0){
    //code here
    }
     
    ThatBox likes this.
Thread Status:
Not open for further replies.

Share This Page