PHP: public function execute(CommandSender $sender, string $commandLabel, array $args) : bool{ if(!$sender instanceof Player){ $sender->sendMessage(C::RED . "Please use this command ingame."); return false; } $world = $this->getServer()->getLevelByName("world"); $x = rand(1,9999); $z = rand(1,9999); $y = $world->getHighestBlockAt($x + 5, $z + 5); $sender->teleport(new Position($x, $y, $z)); return true; } not workinf teleports me to bedrock
Maybe this is a chunk rendering problem, i mean, you need to render the block before processing the event, (but i'm not sure)
you need to go to this area, actually i don't know exactly how to load them whitout going to the area or if has an way to load that.