pocketmine\entity\Item::attack PHP Method

attack() public method

public attack ( $damage, EntityDamageEvent $source )
$source pocketmine\event\entity\EntityDamageEvent
    public function attack($damage, EntityDamageEvent $source)
    {
        if ($source->getCause() === EntityDamageEvent::CAUSE_VOID or $source->getCause() === EntityDamageEvent::CAUSE_FIRE_TICK or $source->getCause() === EntityDamageEvent::CAUSE_ENTITY_EXPLOSION or $source->getCause() === EntityDamageEvent::CAUSE_BLOCK_EXPLOSION) {
            parent::attack($damage, $source);
        }
    }