SHARE
TWEET

Untitled

a guest Jul 17th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import org.bukkit.Bukkit;
  2. import org.bukkit.command.Command;
  3. import org.bukkit.command.CommandExecutor;
  4. import org.bukkit.command.CommandSender;
  5. import org.bukkit.entity.Player;
  6.  
  7.  
  8. public class cmd_bansystem implements CommandExecutor {
  9.    
  10.     public static String prefix = "§7[§9ban§7System§7] ";
  11.    
  12.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  13.         if(cmd.getName().equalsIgnoreCase("ban")) {
  14.             if(!sender.hasPermission("ban.use")) {
  15.                 sender.sendMessage(prefix + "§7Duzu hast du keine Rechte!");
  16.             }
  17.        
  18.            
  19.             if(args.length == 0) {
  20.                
  21.                 sender.sendMessage(prefix + "§7Bitte defiere den Spieler, den du sperren willst.");
  22.                
  23.             }else if(args.length == 1) {
  24.                
  25.                 final Player target = Bukkit.getServer().getPlayer(args[0]);
  26.                 Player p = (Player) sender;
  27.                
  28.                 target.kickPlayer("§cDu wurdest vom Netzwerk ausgeschloßen.");
  29.                 target.setBanned(true);
  30.                
  31.                 p.sendMessage(prefix + "§7Du hast erfolgreich den Spieler §6" + target.getName() + "§7gebannt.");
  32.             }
  33.         }
  34.         return false;
  35.     }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top