foreach(["ban-ip", "ban", "kick"] as $label) { $command = $this->getServer()->getCommandMap()->getCommand($label); if($command instanceof Command) $sender->getServer()->getCommandMap()->unregister($command); else $sender->sendMessage("$label doesn't exist"); }