Hi, i keep getting this error for some reason: PHP: Fatal error: Call to a member function getChunk() on null in phar:///Users/samuel/PluginDevs/PocketMine-MP.phar/src/pocketmine/level/Level.php on line 2039 The Question is WHY? Here is the whole function: PHP: public function restartGame(){ $this->P1 = 0; $this->id = 1; $this->RJ = []; $this->pid = []; $this->starting = 0; $this->winner = ""; $this->Sign1 = $this->lobby->getTile(new Vector3(-10,6,151)); $this->Sign2 = $this->Sign1; //$this->lobby->getTile(new Vector3(-11,6,151)); $this->Sign1->setText("[Join]","******",$this->mapn,0 . "/4 Players"); $this->Sign2->setText("[Join]","*******",$this->mapn,0 . "/4 Players"); $this->players = array(); $this->started = 0; $this->deleteDir(Server::getInstance()->getDataPath() . "worlds/" . $this->tmn); $this->cpr(Server::getInstance()->getDataPath() . "worlds/" . $this->omn,Server::getInstance()->getDataPath() . "worlds/" . $this->tmn); $this->map = Server::getInstance()->getLevelByName($this->tmn); Server::getInstance()->unloadLevel($this->map); Server::getInstance()->loadLevel($this->tmn); $this->map = Server::getInstance()->getLevelByName($this->tmn); } I can get this to work in the onEnable() function: PHP: public function onEnable(){ $this->tmn = "**Secret :P**"; $this->omn = "**Secret :P**"; $this->mapn = "Map: **** [1]"; $this->gmid = "[1]"; $this->leaderboard = new Config($this->getDataFolder() . "/leaderboard.yml", Config::YAML); $this->leaderboard->save(); $this->leaderboard->reload(); $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->getLogger()->info("§l§c***** Loaded!"); Server::getInstance()->loadLevel("*****Lobby"); Server::getInstance()->loadLevel($this->omn); Server::getInstance()->loadLevel($this->tmn); $this->lobby = Server::getInstance()->getLevelByName("*****Lobby"); $this->mapo = Server::getInstance()->getLevelByName($this->omn); $this->rn = 0; $this->inv = []; $this->armor = []; $this->spawns = []; $this->id = 1; $this->Spawn1 = new Vector3(610.5,29,-819.5); $this->Spawn2 = new Vector3(570.5,29,-819.5); $this->Spawn3 = new Vector3(569.5,29,-858.5); $this->Spawn4 = new Vector3(610.5,29,-859.5); $this->restartGame(); } public function restartGame(){ $this->P1 = 0; $this->id = 1; $this->RJ = []; $this->pid = []; $this->starting = 0; $this->winner = ""; $this->Sign1 = $this->lobby->getTile(new Vector3(-10,6,151)); $this->Sign2 = $this->Sign1; //$this->lobby->getTile(new Vector3(-11,6,151)); $this->Sign1->setText("[Join]","SkyWars",$this->mapn,0 . "/4 Players"); $this->Sign2->setText("[Join]","SkyWars",$this->mapn,0 . "/4 Players"); $this->players = array(); $this->started = 0; $this->deleteDir(Server::getInstance()->getDataPath() . "worlds/" . $this->tmn); $this->cpr(Server::getInstance()->getDataPath() . "worlds/" . $this->omn,Server::getInstance()->getDataPath() . "worlds/" . $this->tmn); $this->map = Server::getInstance()->getLevelByName($this->tmn); Server::getInstance()->unloadLevel($this->map); Server::getInstance()->loadLevel($this->tmn); $this->map = Server::getInstance()->getLevelByName($this->tmn); } BUT, when i run it in a EntityLevelChangeEvent, i get that error. Here is the code for that: PHP: public function onWorldChange(EntityLevelChangeEvent $elce){ //$this->getLogger()->info("§cPlayer Moved World"); $wce = $elce->getEntity(); if($wce instanceof Player && $this->P1 < 2){$this->restartGame();} } For some reason, this works in a respawn event! (but i can't use that for my situation) Thanks in advance! I hope i can get this fixed! (also, is it a pocketmine bug? )