Advertisement
Guest User

durpcode

a guest
Oct 16th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel ,String[] args){
  2.         Player player = (Player) sender;
  3.         if(commandLabel.equalsIgnoreCase("pandaport")){
  4.             if(args.length == 0){
  5.                 player.sendMessage(ChatColor.RED+ "No arguments");
  6.             }else if(args.length == 1){
  7.                 Player targetPlayer = player.getServer().getPlayer(args[0]);
  8.                 Location targetPlayerLocation = targetPlayer.getLocation();
  9.                 player.teleport(targetPlayerLocation);
  10.             }else if (args.length == 2){
  11.                 Player targetPlayer = player.getServer().getPlayer(args[0]);
  12.                 Player targetPlayer1 = player.getServer().getPlayer(args[1]);
  13.                 Location targetPlayerLocation = targetPlayer.getLocation();
  14.                 Location targetPlayerLocation1 = targetPlayer1.getLocation();
  15.                 targetPlayer.teleport(targetPlayerLocation);
  16.                 targetPlayer.sendMessage("Ported to "+player.getName());
  17.             }
  18.            
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement