Guys how to fix this kind of error? Code: [11:27:32] [Server thread/CRITICAL]: Error: "Call to a member function getTiles() on null" (EXCEPTION) in "MicroBattle v1.1.0 PRO.phar/src/LittleBigMC/MicroBattles/MicroBattles" at line 633 Here is line 633 PHP: public function onRun($tick) { $allplayers = $this->plugin->getServer()->getOnlinePlayers(); $level = $this->plugin->getServer()->getLevelByName("MBLobby"); $tiles = $level->getTiles(); //Line 633 foreach($tiles as $t) { if($t instanceof Sign) { $text = $t->getText(); if($text[3]==$this->prefix) {
Change PHP: $tiles = $level->getTiles(); to PHP: $tiles = $level->getTiles($allplayers); it error because it didnt has anything to getTiles
While it's easy to think that, the issue is actually that $level is returning null. $level->getTiles doesn't require any parameters. Either MBLobby doesn't exist, or it isn't loaded when this code is being executed. You can't get tiles from a level that isn't loaded.