TheGamerPlayz Posted July 28, 2016 Share Posted July 28, 2016 Using ICommand how would I add permissions to a command? Quote Link to comment Share on other sites More sharing options...
TheGamerPlayz Posted July 28, 2016 Author Share Posted July 28, 2016 So I swapped to CommandBase and I have to say its a bit simpler. I mean a server-side command. It seems that by default you must have OP to use them Quote Link to comment Share on other sites More sharing options...
TheGamerPlayz Posted July 28, 2016 Author Share Posted July 28, 2016 When It auto-implemented the needed methods checkPermissions never appeared. Also what would be the necessary checks? Sorry if I sound like a "noob" I'm used to Spigot. Quote Link to comment Share on other sites More sharing options...
TheGamerPlayz Posted July 28, 2016 Author Share Posted July 28, 2016 I think I misunderstood you or the otherway around, but here is what I have so far. I extended CommandBase, but let Eclipse automatically add everything public class Commands extends CommandBase{ ICommandManager icommandmanager; HashMap<String, HashMap<String, Integer>> plyrStats; public Commands(HashMap<String, HashMap<String, Integer>> plyrStats){ this.plyrStats = plyrStats; } @Override public String getCommandName(){ return "resetstats"; } @Override public String getCommandUsage(ICommandSender icommandsender){ return "ResetStats"; } @Override public void processCommand(ICommandSender icommandsender, String[] args) { resetStats((EntityPlayer) icommandsender); } } Quote Link to comment Share on other sites More sharing options...
TheGamerPlayz Posted July 28, 2016 Author Share Posted July 28, 2016 Sorry, but could you show me what you mean? Every time I try to override checkPermission it says that it is not a proper method and removes @Override Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.