pocketmine\entity\FlyingAnimal::attack PHP Method

attack() public method

public attack ( $damage, EntityDamageEvent $source )
$source pocketmine\event\entity\EntityDamageEvent
    public function attack($damage, EntityDamageEvent $source)
    {
        if ($source->isCancelled()) {
            return;
        }
        if ($source->getCause() == EntityDamageEvent::CAUSE_FALL) {
            $source->setCancelled();
            return;
        }
        parent::attack($damage, $source);
    }