diff --git a/src/item/Mace.php b/src/item/Mace.php index 9d7687476c..b597b86c5c 100644 --- a/src/item/Mace.php +++ b/src/item/Mace.php @@ -26,8 +26,8 @@ use pocketmine\block\Block; use pocketmine\block\BlockToolType; use pocketmine\entity\Entity; +use pocketmine\event\entity\EntityDamageByEntityEvent; use pocketmine\event\entity\EntityDamageEvent; -use pocketmine\event\entity\EntityDemageByEntityEvent; use pocketmine\math\Vector3; class Mace extends Tool{ @@ -63,10 +63,10 @@ public function onDestroyBlock(Block $block, array &$returnedItems) : bool{ return false; } - private function getDemager() : EntityDamageByEntityEvent{ - return $this->demager; + private function getDamager() : ?EntityDamageByEntityEvent{ + return $this->damager ?? null; } - + public function onAttackEntity(EntityDamageByEntityEvent $demager, Entity $victim, array &$returnedItems) : bool{ $damageEvent = $victim->getLastDamageCause();