Guest User

ztrtp

a guest
Jan 11th, 2022
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. @Override
  2. public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] args) {
  3. Player p = (Player)sender;
  4. World w = p.getWorld();
  5.  
  6. int cordsX = 5000;
  7. int cordsZ = 5000;
  8.  
  9. Random rand = new Random();
  10.  
  11. double x = -1 ^ rand.nextInt(cordsX);
  12. double y = 63.0;
  13. double z = rand.nextInt(cordsZ);
  14.  
  15. Location loc = new Location(w, x, y, z);
  16.  
  17. loc.setY((double)(loc.getWorld().getHighestBlockYAt(loc) + 3));
  18. p.teleport(loc);
  19. p.playSound(p.getLocation(), Sound.BLOCK_BEACON_ACTIVATE, 3F, 1F);
  20. p.sendMessage("§8( §a◌ §8) §7Teleported You Randomly!");
  21. return false;
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment