Soo i recently mad a plugin to tell you how to do things like buying land but i have something strange The return true message and return false message had to be switched If i do it like this = PHP: public function onCommand(CommandSender $sender,command $command, $label, array $args) { switch($command->getName()){ case "ILandbuy": $sender->sendMessage("Hello ".$sender->getName()."!"); $sender->sendMessage("thank you for reading the instructions"); $sender->sendMessage("type /startp on the corner of your land and /endp on the other corner. after that type /landbuy"); $sender->sendMessage("use landbuy to protect your land from griefers."); return true; default: $sender->sendMessage("Acces denied"); return false; case "IFactions": $sender->sendMessage("Acces denied"); return false; default: $sender->sendMessage("Hello ".$sender->getName()."!"); $sender->sendMessage("Sorry this instruction is still in progress"); return true; Everything will be correct but If i do it like this PHP: public function onCommand(CommandSender $sender,command $command, $label, array $args) { switch($command->getName()){ case "ILandbuy": $sender->sendMessage("Access denied"); return false; default: $sender->sendMessage("Hello ".$sender->getName()."!"); $sender->sendMessage("thank you for reading the instructions"); $sender->sendMessage("type /startp on the corner of your land and /endp on the other corner. after that type /landbuy"); $sender->sendMessage("use landbuy to protect your land from griefers."); return true; case "IFactions": $sender->sendMessage("Acces denied"); return false; default: $sender->sendMessage("Hello ".$sender->getName()."!"); $sender->sendMessage("Sorry this instruction is still in progress"); return true; The /ILandbuy command will just say Acces denied while the /IFaction command will say the correct message. Why is it like that?
You only need one default. Please take a look at the PHP manual and learn about control structures: https://secure.php.net/manual/en/control-structures.switch.php