Hello, i have this problem: https://hastebin.com/ulopelaqij.swift The event is that if a player contains the arraylist "freezer" and the sender execute the "/ ban" command, you can't use the command. Sorry for my english, and thanks for reading.
Yeah this is and better idea! Let your class implement "CommandExecutor" and do it like this: Code (Text): public class BanCommand implements CommandExecutor{ @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (sender instanceof Player) { Player p = (Player) sender; if (cmd.getName().equalsIgnoreCase("ban")) { if (freezer.contains(p.getName())) { p.sendMessage(Utils.prefix + ChatColor.RED + "You don't have permissions to execute this command."); } } } return false; } } You also have to register the command in you main class in your onEnable(): Code (Text): getCommand("ban").setExecutor(new BanCommand(), this);
Try debugging your arraylist by printing it to the console to check if the player's name is in the arraylist to begin with.