diff --git a/src/entity/ai/MobController.php b/src/entity/ai/MobController.php index ec108e8c..91413a3d 100644 --- a/src/entity/ai/MobController.php +++ b/src/entity/ai/MobController.php @@ -50,7 +50,7 @@ class MobController if($pitch){ $diff = sqrt($x * $x + $z * $z); $calcPitch = rad2deg(atan($y / $diff)); - $this->entity->pitch = $calcPitch; + $this->entity->pitch = $this->entity->type === MOB_CHICKEN ? -$calcPitch : $calcPitch; } $this->entity->server->query("UPDATE entities SET pitch = ".$this->entity->pitch.", yaw = ".$this->entity->yaw." WHERE EID = ".$this->entity->eid.";"); diff --git a/src/entity/ai/tasks/TaskTempt.php b/src/entity/ai/tasks/TaskTempt.php index d4883223..e155c0d5 100644 --- a/src/entity/ai/tasks/TaskTempt.php +++ b/src/entity/ai/tasks/TaskTempt.php @@ -17,7 +17,7 @@ class TaskTempt extends TaskBase public function onUpdate(EntityAI $ai) { - if($this->target instanceof Entity && $this->target->distanceSquared($ai->entity) > 100 || !$ai->entity->isFood($this->target->player->getHeldItem()->getID())){ + if($this->target instanceof Entity && $this->target->isPlayer() && $this->target->distanceSquared($ai->entity) > 100 || !$ai->entity->isFood($this->target->player->getHeldItem()->getID())){ $this->reset(); return; } diff --git a/src/entity/animal/Chicken.php b/src/entity/animal/Chicken.php index e01ef6c7..ab11f461 100644 --- a/src/entity/animal/Chicken.php +++ b/src/entity/animal/Chicken.php @@ -8,7 +8,7 @@ class Chicken extends Animal{ parent::__construct($level, $eid, $class, $type, $data); $this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 4, "generic"); $this->setName('Chicken'); - $this->setSize($this->isBaby() ? 0.2 : 0.4, $this->isBaby() ? 0.35 : 0.7); + $this->setSize($this->isBaby() ? 0.2 : 0.3, $this->isBaby() ? 0.35 : 0.4); $this->setSpeed(0.25); $this->update(); }