I wanna let the user run the command weather they put it all caps or all lower im sure it could be accomplished with strtolower but what abt upper? And using both? Spoiler: Display Code Code: public function onCommand(CommandSender $sender,Command $command,$commandLabel, array $args){ $item = $this->getConfig()->get("itemid"); if($command->getName() === "Enchant"){ return true; } return false; }
PHP: strtolower($command->getName());//I know this works but don't know if it's a bad practice :Pstrtolower($command);
You didn't look at the first post, didn't you? He meant this: PHP: //from:if($command->getName() === "name"){ //code}//repeat that like 12 times//to:switch($command->getName()){ //this way you don't need a bunch of if statements}
there i dont know why you guys just dont post the right way to do it... hes asking such a simple question with a simple answer PHP: switch (strtolower($command->getName())){ case "command1": break; case "command2": break; // and so on..}