Exemplo n.º 1
0
 public function attack($damage, EntityDamageEvent $source)
 {
     parent::attack($damage, $source);
     if (!$source->isCancelled()) {
         $this->setAngry(1000);
     }
 }
Exemplo n.º 2
0
 public function initEntity()
 {
     $this->setMaxHealth(100);
     parent::initEntity();
     $this->setFriendly(true);
     $this->setDamage([0, 21, 21, 21]);
     $this->setMinDamage([0, 7, 7, 7]);
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 public function initEntity()
 {
     parent::initEntity();
     $this->setDamage([0, 3, 4, 6]);
 }
Exemplo n.º 5
0
 public function targetOption(Creature $creature, float $distance) : bool
 {
     return $this->isAngry() && parent::targetOption($creature, $distance);
 }
Exemplo n.º 6
0
 public function initEntity()
 {
     parent::initEntity();
     $this->setMaxHealth(12);
     $this->setDamage([0, 2, 3, 3]);
 }
Exemplo n.º 7
0
 public function saveNBT()
 {
     $this->namedtag->BombTime = new IntTag("BombTime", $this->bombTime);
     parent::saveNBT();
 }
Exemplo n.º 8
0
 public function initEntity()
 {
     parent::initEntity();
     $this->setFriendly(true);
 }