Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void randomTeleport(Player p) {
- Random r = new Random();
- int x, z = x = z = r.nextInt();
- while (!p.getWorld().getGenerator().canSpawn(p.getWorld(), x, z)) x = z = r.nextInt();
- p.teleport(new Location(p.getWorld(), x, z, p.getWorld().getHighestBlockYAt(x, z)));
- }
Add Comment
Please, Sign In to add comment