PocketMine-MP Crash Dump Wed Nov 25 15:48:59 UTC 2015 Error: Call to a member function getName() on null File: /src/pocketmine/level/Level__32bit Line: 2734 Type: E_ERROR Code: [2725] return (int) $this->time; [2726] } [2727] [2728] /** [2729] * Returns the Level name [2730] * [2731] * @return string [2732] */ [2733] public function getName(){ [2734] return $this->provider->getName(); [2735] } [2736] [2737] /** [2738] * Returns the Level folder name [2739] * [2740] * @return string [2741] */ [2742] public function getFolderName(){ [2743] return $this->folderName; [2744] } Backtrace: #0 (): pocketmine\Server->crashDump(boolean) Error, when i try unload level My code: $levelname = $this->getServer()->getLevelByName("worlder"); $check = count($this->getServer()->getLevelByName("worlder")->getPlayers()); if($check == 0){ $this->reseting($levelname); /*$lvl = $this->getServer()->getLevelByName("worlder"); $this->getServer()->unloadLevel($lvl);*/ } } } } } } } //================================== public function reseting(Level $level){ $this->getServer()->unloadLevel($level); }
You made (?) those mistakes: 1) Firstly, onEnable(), add ...loadLevel("worlder"); 2) Your world isn't loaded => You can't use getLevelByName(); 3) It can also crash when you try to unload Level which is not loaded
you can use this plugin to load and unload worlds https://forums.pocketmine.net/plugins/manyworlds.1042/