From bfc5e2067aefd5aba788564c73a4c259f4a9878d Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Mon, 26 Feb 2024 03:00:01 +0300 Subject: [PATCH] creeper will attacc --- src/entity/monster/Creeper.php | 2 ++ src/entity/monster/Zombie.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/entity/monster/Creeper.php b/src/entity/monster/Creeper.php index 6d0ca6ad..2978df34 100644 --- a/src/entity/monster/Creeper.php +++ b/src/entity/monster/Creeper.php @@ -3,6 +3,7 @@ class Creeper extends Monster{ const TYPE = MOB_CREEPER; const EXPL_TIME = 30; public $timeUntilExplode; + public $activatedByPlayer = false; function __construct(Level $level, $eid, $class, $type = 0, $data = []){ $this->setSize(0.6, 1.7); parent::__construct($level, $eid, $class, $type, $data); @@ -13,6 +14,7 @@ class Creeper extends Monster{ $this->timeUntilExplode = $this->isIgnited() ? self::EXPL_TIME : 0; $this->ai->addTask(new TaskRandomWalk(1.0)); + $this->ai->addTask(new TaskAttackPlayer(1.25, 16)); $this->ai->addTask(new TaskLookAround()); $this->ai->addTask(new TaskSwimming()); } diff --git a/src/entity/monster/Zombie.php b/src/entity/monster/Zombie.php index 491ee857..c98e8d29 100644 --- a/src/entity/monster/Zombie.php +++ b/src/entity/monster/Zombie.php @@ -11,7 +11,7 @@ class Zombie extends Monster{ $this->ai->addTask(new TaskRandomWalk(1.0)); $this->ai->addTask(new TaskLookAround()); $this->ai->addTask(new TaskSwimming()); - $this->ai->addTask(new TaskAttackPlayer(1.0, 16)); //TODO fix range? + $this->ai->addTask(new TaskAttackPlayer(1.0, 16)); } public function getArmorValue(){