ai will stop executing if entity is ded

This commit is contained in:
GameHerobrine 2023-01-30 13:54:13 +03:00
parent 61e44fddba
commit 695f9f1484

View file

@ -30,7 +30,7 @@ abstract class Living extends Entity implements Damageable, Pathfindable{
} }
public function update(){ public function update(){
if(Entity::$allowedAI && $this->idleTime <= 0) { if(!$this->dead && Entity::$allowedAI && $this->idleTime <= 0) {
$this->ai->updateTasks(); $this->ai->updateTasks();
} }
if($this->onGround){ if($this->onGround){