not ideal POC: you can try summoning a fake player to run that cmd which use regex+return data to check if the cmd exist i think there's a getcommand map and if lable exist or something like that since it's used in overwriting default commands i dont see why it cant check if one existed
'if' is not a function in any programming language I know of. It's a control structure, you can read more about php control structures over on php.net. We can use pocketmine\command\SimpleCommandMap::getCommand() to check if a command exists -- see below: PHP: if(pocketmine\command\SimpleCommandMap::getCommand("commandnameoraliashere") instanceof pocketmine\command\Command) { echo "Command exists!" . PHP_EOL;} else { echo "Command does not exist :c" . PHP_EOL;}