Example #1
0
 public function initEntity()
 {
     //^ changed from protected->public for 1.5
     parent::initEntity();
     if (isset($this->namedtag->Owner)) {
         $this->owner = $this->namedtag["Owner"];
     } else {
         $this->owner = "";
     }
     $x = floor($this->namedtag->Pos[0]);
     $y = floor($this->namedtag->Pos[1]);
     $z = floor($this->namedtag->Pos[2]);
     $mgr = $this->server->getPluginManager()->getPlugin("Mobsters");
     if ($mgr) {
         list($owner, $id) = $mgr->getSpawner($x, $y, $z);
         if ($owner && $id == self::NETWORK_ID) {
             $this->owner = $owner;
             $this->namedtag->Owner = new String("Owner", $this->owner);
         }
     }
     if ($this->owner) {
         echo "Perrito de " . $this->owner . "\n";
     }
     //##DEBUG
 }
Example #2
0
 public function initEntity()
 {
     $this->setMaxHealth(6);
     parent::initEntity();
     /*for($i = 1; $i < 40; $i++){
     			$this->setDataProperty($i, self::DATA_TYPE_BYTE, 1);
     		}*/
 }
Example #3
0
 public function initEntity()
 {
     $this->setMaxHealth(3);
     parent::initEntity();
     if (!isset($this->namedtag->Type)) {
         $this->setType(mt_rand(0, 5));
     }
 }
Example #4
0
 public function initEntity()
 {
     $this->setMaxHealth(8);
     parent::initEntity();
     if (!isset($this->namedtag->Color) || $this->getVariant() > 15) {
         $this->setVariant(mt_rand(0, 15));
     }
     $this->setDataProperty(16, self::DATA_TYPE_BYTE, $this->getVariant());
 }
Example #5
0
 public function initEntity()
 {
     $this->setMaxHealth(20);
     parent::initEntity();
     if (!isset($this->namedtag->Profession) || $this->getVariant() > 4) {
         $this->setVariant(mt_rand(0, 4));
     }
     $this->setDataProperty(16, self::DATA_TYPE_BYTE, $this->getVariant());
 }
Example #6
0
 public function initEntity()
 {
     $this->setMaxHealth(10);
     parent::initEntity();
     //0 burning
     //1 air time
     //5 invis
     //14 age (0=baby 130000 = parent)
     //15 no movement
     //16 sheep color
     //18 type/variant
     //19 creeper charged
     //21 love
     if (!isset($this->namedtag->Type) || $this->getVariant() > 3) {
         $this->setVariant(self::TYPE_NORMAL);
     }
     $this->setDataProperty(16, self::DATA_TYPE_BYTE, $this->getVariant());
 }
Example #7
0
 public function initEntity()
 {
     $this->setMaxHealth(10);
     parent::initEntity();
 }
Example #8
0
 public function initEntity()
 {
     $this->setMaxHealth(8);
     //Untamed
     parent::initEntity();
 }
Example #9
0
 public function initEntity()
 {
     parent::initEntity();
     $this->setMaxHealth(2);
     $this->setHealth(2);
 }