@param Entity $theplayetplayer */ public function attackEntity(Entity $theplayer){ if($this->attackDelay > 10 && $this->distanceSquared($player) < 2){ $this->attackDelay = 0; $damage = $this->getDamage(); if($this->getMobEquipment() !== null){ $damage = $damage + $this->getMobEquipment()->getWeaponDamageToAdd(); } $v = new EntityDamageByEntityEvent($this, $player, EntityDamageEvent::CAUSE_ENTITY_ATTACK, MobDamageCalculator::calculateFinalDamage($player, $damage)); $player->attack($ev); $this->checkTamedMobsAttack($theplayer); }