creepers will explode if they are in 3 block radius from the player

This commit is contained in:
GameHerobrine 2024-07-02 23:12:45 +03:00
parent 72a1a93283
commit e28498c4c2
2 changed files with 4 additions and 2 deletions

View file

@ -58,7 +58,7 @@ class Creeper extends Monster{
}
public function attackEntity($entity, $distance){
if(Utils::distance_noroot($entity, $this) <= 49 && !$this->isIgnited()){
if(Utils::distance_noroot($entity, $this) <= 49 && !$this->isIgnited() && $this->ai->canSee($entity)){
$this->ignite();
return true;
}