public function onExecute(CommandSender $sender, string $commandLabel, array $args) : bool
{
/** @var Player $sender */
$world = $sender->getWorld();
$x = random_int(-800, 800);
$z = random_int(-800, 800);
$world->loadChunk($x >> 4, $z >> 4);
$y = $world->getHighestBlockAt($x, $z) + 1;
$sender->teleport(new Vector3($x, $y, $z));
return true;
}
[Server thread/CRITICAL]: pocketmine\world\WorldException: “Cannot get highest block in an ungenerated chunk” (EXCEPTION) in “pmsrc/src/world/World” at line 2814