Guest User

Untitled

a guest
Jul 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. void randomTeleport(Player p) {
  2. Random r = new Random();
  3. int x, z = x = z = r.nextInt();
  4.  
  5. while (!p.getWorld().getGenerator().canSpawn(p.getWorld(), x, z)) x = z = r.nextInt();
  6.  
  7. p.teleport(new Location(p.getWorld(), x, z, p.getWorld().getHighestBlockYAt(x, z)));
  8. }
Add Comment
Please, Sign In to add comment