OK so I'm creating a plugin, but it has multiple commands. They work but when one of them is used the other one is used also. For example if I had two commands called "hello" and "hey". If I run /hey, /hello would be run also. How do I make one run without the other one being run? I have both of them under the same public function onCommand() Do they need to be under seperatre public functions? Any help would be greatly appreciated
You should check the name of the second parameter (Command) of onCommand. PHP: public function onCommand(CommandSender $issuer, Command $com, $lbl, array $params){ if($com->getName() === "name1") { $issuer->sendMessage("You ran /name1"); return true; } if($com->getName() === "name2") { $issuer->sendMessage("You ran /name2"); return true; } return false;}