public function attack($damage, EntityDamageEvent $source) { parent::attack($damage, $source); if (!$source->isCancelled()) { $this->setAngry(1000); } }
public function initEntity() { $this->setMaxHealth(100); parent::initEntity(); $this->setFriendly(true); $this->setDamage([0, 21, 21, 21]); $this->setMinDamage([0, 7, 7, 7]); }
public function entityBaseTick($tickDiff = 1) { Timings::$timerEntityBaseTick->startTiming(); $hasUpdate = parent::entityBaseTick($tickDiff); $time = $this->getLevel()->getTime() % Level::TIME_FULL; if (($time < Level::TIME_NIGHT || $time > Level::TIME_SUNRISE) && !$this->isOnFire()) { $this->setOnFire(5); } Timings::$timerEntityBaseTick->startTiming(); return $hasUpdate; }
public function initEntity() { parent::initEntity(); $this->setDamage([0, 3, 4, 6]); }
public function targetOption(Creature $creature, float $distance) : bool { return $this->isAngry() && parent::targetOption($creature, $distance); }
public function initEntity() { parent::initEntity(); $this->setMaxHealth(12); $this->setDamage([0, 2, 3, 3]); }
public function saveNBT() { $this->namedtag->BombTime = new IntTag("BombTime", $this->bombTime); parent::saveNBT(); }
public function initEntity() { parent::initEntity(); $this->setFriendly(true); }