|
PocketMine-MP 5.36.1 git-eaa7c4834c8fe2f379d24e7f0ee6cc63cfb18ccc
|
Inheritance diagram for pocketmine\command\CommandMap:
Collaboration diagram for pocketmine\command\CommandMap:Public Member Functions | |
| clearCommands () | |
| dispatch (CommandSender $sender, string $cmdLine) | |
| getAliasMap () | |
| getCommand (string $name, ?CommandAliasMap $senderAliasMap=null) | |
| register (Command $command, array $otherAliases=[]) | |
Definition at line 26 of file CommandMap.php.
| pocketmine\command\CommandMap::getAliasMap | ( | ) |
Returns the global alias map for this command map. Aliases in this map will be used as a fallback when user-specific aliases don't give any results.
Implemented in pocketmine\command\SimpleCommandMap.
| pocketmine\command\CommandMap::getCommand | ( | string | $name, |
| ?CommandAliasMap | $senderAliasMap = null ) |
Returns the command(s) bound to the given name or alias. This will return an array if the alias is conflicted (multiple commands bound to it).
Implemented in pocketmine\command\SimpleCommandMap.
| pocketmine\command\CommandMap::register | ( | Command | $command, |
| array | $otherAliases = [] ) |
Registering a command with (command(namespace="myplugin", name="mycommand"), otherAliases=["myc"]) will bind:
If two commands claim the same alias, it will become conflicted, and neither command will be usable with that alias unless the alias is explicitly rebound in the alias map. The user will be shown an error when trying to use it, listing all namespaced names (not aliases) of the commands bound to it. The user can then use one of the namespaced names to run the command they want.
| string[] | $otherAliases |
@phpstan-param list<string> $otherAliases
Implemented in pocketmine\command\SimpleCommandMap.