Im using this code structure to allow somebody to accept a gamble request from another user. All of the code up to the "hfaccept" command works but when the receiving user enters "/hfaccept" they get an error in chat saying "An internal error occurred while attempting to perform this command". Am i going about the right way of creating a response command? CODE STRUCTURE: if (cmd.getName().equalsIgnoreCase("hf")) { (User sends request) if (cmd.getName().equalsIgnoreCase("hfaccept")) { (User accepts request) } }
Post the stacktrace. Show more code. Post the complete class. I would prefer and recommend separated CommandExecutors (http://bukkit.gamepedia.com/Plugin_Tutorial#Using_a_separate_CommandExecutor_class).
You should do this instead: Code (Text): if (cmd.getName().equalsIgnoreCase("hf")) { (User sends request) }else if (cmd.getName().equalsIgnoreCase("hfaccept")) { (User accepts request) } You can't check if the command is "hfaccept" within the other command, because if it equals "hf", it can't also equal "hfaccept" which is what you're checking within that if.