public function initEntity() { parent::initEntity(); if (isset($this->namedtag->Experience)) { $this->experience = $this->namedtag["Experience"]; } else { $this->close(); } }
protected function initEntity() { parent::initEntity(); $this->setMaxHealth(1); $this->setHealth(1); if (isset($this->namedtag->Age)) { $this->age = $this->namedtag["Age"]; } }
protected function initEntity() { parent::initEntity(); if (isset($this->namedtag->Fuse)) { $this->fuse = $this->namedtag["Fuse"]; } else { $this->fuse = 80; } }
protected function initEntity() { parent::initEntity(); if (isset($this->namedtag->HealF)) { $this->namedtag->Health = new Short("Health", (int) $this->namedtag["HealF"]); unset($this->namedtag->HealF); } if (!isset($this->namedtag->Health) or !$this->namedtag->Health instanceof Short) { $this->namedtag->Health = new Short("Health", $this->getMaxHealth()); } $this->setHealth($this->namedtag["Health"]); }
protected function initEntity() { parent::initEntity(); if (isset($this->namedtag->TileID)) { $this->blockId = $this->namedtag["TileID"]; } elseif (isset($this->namedtag->Tile)) { $this->blockId = $this->namedtag["Tile"]; $this->namedtag["TileID"] = new Int("TileID", $this->blockId); } if (isset($this->namedtag->Data)) { $this->damage = $this->namedtag["Data"]; } if ($this->blockId === 0) { $this->close(); return; } $this->setDataProperty(self::DATA_BLOCK_INFO, self::DATA_TYPE_INT, $this->getBlock() | $this->getDamage() << 8); }
protected function initEntity() { parent::initEntity(); $this->setMaxHealth(5); $this->setHealth($this->namedtag["Health"]); if (isset($this->namedtag->Age)) { $this->age = $this->namedtag["Age"]; } if (isset($this->namedtag->PickupDelay)) { $this->pickupDelay = $this->namedtag["PickupDelay"]; } if (isset($this->namedtag->Owner)) { $this->owner = $this->namedtag["Owner"]; } if (isset($this->namedtag->Thrower)) { $this->thrower = $this->namedtag["Thrower"]; } if (!isset($this->namedtag->Item)) { $this->close(); return; } $this->item = NBT::getItemHelper($this->namedtag->Item); $this->server->getPluginManager()->callEvent(new ItemSpawnEvent($this)); }