Hello everyone. So, I am really new to plugin development and don't have a clue what to do here: http://prntscr.com/6e925n. can someone help me please? I want it so when people do the command "/nbkick <player> <reason>" it broadcasts to all the Staff Members "<player> has been kicked by <player> for <reason>". I will appreciate anyones help!
Hello, what you are doing wrong is that the BukkitAPI doesn't have a player meathod "kickPlayer()". There is "kickPlayer("Reason"); I will not spoonfeed you code also. Try learning the Bukkit API from decompiling other plugins, or learning Java from oracles website, instead of learning Java FROM Bukkit.
The reason you are getting that error is because the method 'kickPlayer' requires a string parameter for a message the player will receive when they are kicked. E.G Code: p.kickPlayer("You have been kicked for " + reason); There are also many things you are doing wrong there, at the moment you are trying to kick the player who executes the command. Try getting the arguments and kicking a target player. You may want to use a StringBuilder to build a reason too, a sample piece of code is shown below: Code: StringBuilder sb = new StringBuilder(); for(int i = 1; i < args.length; i++) { sb.append(args[i] + " "); } String reasonToKick = sb.toString().trim();