13:39:57 [INFO] [SVIP] You can't do that. 13:39:57 [INFO] [SVIP] You can't do that. 13:39:57 [INFO] [SVIP] You can't do that. 13:39:57 [INFO] Usage: /vipheal And this happening even i send it as VIP and from MCPE! here's the code: PHP: public function onCommand(CommandSender $sender, Command $command, $label, array $args){ switch($command->getName()){ case "vipheal": $name = $sender->getName(); if(in_array($name, $this->getConfig()->get("vips"), true) && $sender instanceof Player){ $sender->setHealth($sender->getMaxHealth()); } else{ $sender->sendMessage(TextFormat::RED."[SVIP] You can't do that."); }
1. After returning, break is dead code that won't be run. 2. You don't need to break or return. Returning a boolean is something a plugin should do, but not doing it won't break the plugin, just send the usage message.