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

@ -30,7 +30,9 @@ class TaskAttackPlayer extends TaskBase
--$this->attackCounter;
$v1 = $ai->entity->width * $ai->entity->width * 4;
if($ai->entity instanceof Creeper){
$v1 = 9;
}
$e = $ai->entity;
$t = $e->target;
$xDiff = ($t->x - $e->x);

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;
}