hey there, how can i make it /gms <player>? what i've done: PHP: public function execute(CommandSender $sender, $commandLabel, array $args){ $player = $sender; if($sender->hasPermission("staff")){ $player->setGamemode(0); $player->sendMessage("§eYou are now in survival mode"); }else{ $sender->sendMessage("§cInvalid Permission"); } }
it is but someone out of the A-Team decided your thread belongs to Development/Facepalm. Regarding your question: you need to check if in the array args (arguments) there is a string in index 0, then check if that string is a playername of an online player and then execute the gamemode change on that.