menu
#5037753 Call to a member function getHighestBlockAt() on null

Submitted by PocketMine-MP 3.22.0

General information

Version: 3.22.0
Git commit: c32c2146
Plugin involvement: Direct
Report date: 2021-07-21 22:06:34 +0000 UTC
Server uptime: 0 days 0 hours 0 minutes 13 seconds

System Information

PHP version: 7.4.15
Operating system: linux
System banner: Linux 21f73ee0-63eb-41cc-a5d5-fc21d17c6533 4.15.0-130-generic #134-Ubuntu SMP Tue Jan 5 20:46:26 UTC 2021 x86_64

Error information

Warning: the CratesRandomBP plugin was directly involved in this crash. Please contact the plugin author.
Message: Call to a member function getHighestBlockAt() on null
File: plugins/CratesRandomBP.phar/src/ByPaps/CratesRandomBP/SpawnTask
Line: #71
Error level: Error
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
        }
}
public function getRandomWorldSpawn($world_name){
$worlds = $this->plugin->config->get("worlds");
foreach($worlds as $world){
if($world["name"] === $world_name){
$level = $this->plugin->getServer()->getLevelByName($world["name"]);
$x = mt_rand($world["min_x"], $world["max_x"]);
$z = mt_rand($world["min_z"], $world["max_z"]);
$y = $level->getHighestBlockAt($x + 1, $z + 1);
if($y === -1){
return null;
}
return [$x, $y, $z];
}
}
return null;
}
}
#0 plugins/CratesRandomBP.phar/src/ByPaps/CratesRandomBP/SpawnTask(29): ByPaps\CratesRandomBP\SpawnTask->getRandomWorldSpawn(string[5] world)
#1 pmsrc/src/pocketmine/scheduler/TaskHandler(137): ByPaps\CratesRandomBP\SpawnTask->onRun(integer 200)
#2 pmsrc/src/pocketmine/scheduler/TaskScheduler(179): pocketmine\scheduler\TaskHandler->run(integer 200)
#3 pmsrc/src/pocketmine/plugin/PluginManager(654): pocketmine\scheduler\TaskScheduler->mainThreadHeartbeat(integer 200)
#4 pmsrc/src/pocketmine/Server(2389): pocketmine\plugin\PluginManager->tickSchedulers(integer 200)
#5 pmsrc/src/pocketmine/Server(2152): pocketmine\Server->tick()
#6 pmsrc/src/pocketmine/Server(1992): pocketmine\Server->tickProcessor()
#7 pmsrc/src/pocketmine/Server(1586): pocketmine\Server->start()
#8 pmsrc/src/pocketmine/PocketMine(291): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/container/, string[24] /home/container/plugins/)
#9 pmsrc/src/pocketmine/PocketMine(321): pocketmine\server()
#10 pmsrc(11): require(string[71] phar:///home/container/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show