Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- public class kaotp implements CommandExecutor {
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (cmd.getName().equalsIgnoreCase("tp")) {
- if (sender instanceof Player) {
- Player p = (Player) sender;
- // rechte
- Location loc = p.getLocation();
- if (args.length == 0) {
- p.sendMessage("§7[§6TP§7] §cSytanx§7: /§6tp §7<§6Player§7> <§6Name§7>");
- } else if (args.length == 1) {
- Player target = Bukkit.getPlayer(args[0]);
- if (target != null) {
- p.teleport(target.getLocation());
- p.sendMessage("§7[§6TP§7] §aDu wurdest Tpt!");
- } else {
- p.sendMessage("§7[§6TP§7] Fehler");
- }
- } else if (args.length == 2) {
- Player targt = Bukkit.getPlayer(args[1]);
- if (targt != null) {
- targt.teleport(p.getLocation());
- p.sendMessage("§7[§6TP§7] §aDu wurdest zu §6" + targt.getName() + " §ateleportier!");
- }
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement