/** * @param Entity $damager * @param Entity $entity * @param int $cause * @param int|int[] $damage * @param float $knockBack */ public function __construct(Entity $damager, Entity $entity, $cause, $damage, $knockBack = 0.4) { $this->damager = $damager; $this->knockBack = $knockBack; parent::__construct($entity, $cause, $damage); $this->addAttackerModifiers($damager); }
/** * @param Block $damager * @param Entity $entity * @param int $cause * @param int|int[] $damage */ public function __construct(Block $damager, Entity $entity, $cause, $damage) { $this->damager = $damager; parent::__construct($entity, $cause, $damage); }