Advertisement
Zitugi

Problème pour récupérer le joueur

Oct 30th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. package fr.zitugi.antikikoo;
  2.  
  3. import org.bukkit.Bukkit;
  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 MuteCommand implements CommandExecutor {
  10.  
  11.     @Override
  12.     public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {
  13.        
  14.         if(sender instanceof Player){
  15.             if(cmd.getName().equalsIgnoreCase("mute")){
  16.                 if(args.length != 1){
  17.                     sender.sendMessage("§cSyntaxe : /mute <Player>");
  18.                 }
  19.                 else{
  20.                     Player target = Bukkit.getServer().getPlayer(args[1]);
  21.                     Mute.getInstance().setMute(target, sender.getName());
  22.                 }
  23.             }
  24.         }
  25.        
  26.         return false;
  27.     }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement