Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. if(!(sender instanceof Player)) return false;
  2. Player player = (Player)sender;
  3. if(command.getName() == "teleport") {
  4.     if(args.length == 1) {
  5.         List<Player> matches = getServer().matchPlayer(args[0])
  6.         if(matches.size()>1) {
  7.             player.teleport(matches.get(0));
  8.         } else {
  9.             if(matches.size()==0)
  10.                 player.sendMessage(args[0] + " could not be found.");
  11.             else
  12.                 player.sendMessage("Too many matches for "+args[0]);
  13.         }
  14.     } else {
  15.         player.sendMessage("Invalid command.");
  16.     }
  17.     return true;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement