Solved ProjectileHitEvent

Discussion in 'Spigot Plugin Development' started by WeedMan420, Feb 2, 2020.

  1. if an arrow is shot at a mob, i want the mob to take no damage, there is no event.setcancelled there, i tried using entity.sethealth(entity.gethealth) but that dnt work, i thought of "healing" the mob when hit but that is not a good idea, and i tried using entity.damage(0) but that only took away the knockback, the mob still gets hurt, how do i do it?
     
  2. EntityDamageByEntityEvent
    Check if the damager is an Arrow and the entity is a Sheep
    e.setCancelled(true);
     
    • Winner Winner x 1
  3. i tried to entitydamagebyentity event before but i made the projectie an entity rather then the damager, thx, it worked