Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1.  
  2. import org.bukkit.Bukkit;
  3. import org.bukkit.Location;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandExecutor;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8.  
  9. public class kaotp implements CommandExecutor {
  10.  
  11. @Override
  12. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  13. if (cmd.getName().equalsIgnoreCase("tp")) {
  14. if (sender instanceof Player) {
  15. Player p = (Player) sender;
  16. // rechte
  17. Location loc = p.getLocation();
  18. if (args.length == 0) {
  19. p.sendMessage("§7[§6TP§7] §cSytanx§7: /§6tp §7<§6Player§7> <§6Name§7>");
  20. } else if (args.length == 1) {
  21. Player target = Bukkit.getPlayer(args[0]);
  22. if (target != null) {
  23. p.teleport(target.getLocation());
  24. p.sendMessage("§7[§6TP§7] §aDu wurdest Tpt!");
  25. } else {
  26. p.sendMessage("§7[§6TP§7] Fehler");
  27. }
  28. } else if (args.length == 2) {
  29. Player targt = Bukkit.getPlayer(args[1]);
  30. if (targt != null) {
  31.  
  32. targt.teleport(p.getLocation());
  33. p.sendMessage("§7[§6TP§7] §aDu wurdest zu §6" + targt.getName() + " §ateleportier!");
  34. }
  35. }
  36. }
  37. }
  38. return false;
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement