I was wondering how to make a custom command within a .jar plugin that gives the specified player operator status.
Create a plugin such as explained in official spigot wiki or here
Create a new command such as explained in official spigot wiki
When player run command, use player.setOp(true);
Full command example (have to be runned as console) :
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(sender instanceof ConsoleCommandSender) { // only for console
if(args.length == 0 || Bukkit.getPlayer(args[0]) == null) { // don't give player or unknow name
sender.sendMessage("Unknow given player");
} else {
Player cible = Bukkit.getPlayer(args[0]);
cible.setOp(true);
sender.sendMessage(cible.getName() + " is now OP");
}
} else {
sender.sendMessage("You are not allowed to do this");
}
return false;
}