When I type '/cb mute' it always says you don't have permission. I'm not getting any errors. onCommand: Code: public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (cmd.getName().equalsIgnoreCase("cb")){ if(args.length != 0){ if(args[0].matches("mute")){ if(perms.canMute(sender)){ if(args.length == 1){ sender.sendMessage(args[1]+" has been notified and Muted!"); } else{ sender.sendMessage("please enter the name of the player being muted eg: "); sender.sendMessage("/cb mute [player]"); } } else{ sender.sendMessage("You do not have permsion!"); } } else if(args[0].matches("about")){ sender.sendMessage(ChatColor.GREEN + this.pdfile.getName()+" version "+this.pdfile.getVersion()); } else{ sender.sendMessage(ChatColor.RED+"Command not reconized: "+ cmd.getLabel()); } return true; } else{ sender.sendMessage(ChatColor.GREEN + this.pdfile.getName()+" version "+this.pdfile.getVersion()); return true; } } return false; } perms implementation: Code: package me.JnH.ChatterBox; import org.bukkit.command.CommandSender; import org.bukkit.plugin.Plugin; public class perms { private Plugin plugin; public perms(Plugin plugin){ this.plugin = plugin; } public boolean canMute(CommandSender sender){ if(sender.hasPermission("cbox.canmute")){ return true; } else{ return false; } } }
tomjw64 yes I have tried it as both an op and as the console. I think my plugin.yml is setup right: Code: permissions: cbox.*: description: Default Chatterbox permisions. children: cbox.canmute: false cbox.canmute: description: Allows you to mute a player default: op
I think it's a problem with this line: Code: if(perms.canMute(sender)){ try just: Code: if(sender.hasPermission("cbox.canmute")){
that did not help. my problem with with Code: cbox.*: description: Default Chatterbox permisions. children: cbox.canmute: false cbox.canmute was set to false and it would not allow anyone to use it.