CommandAPI
CommandAPI copied to clipboard
[SUGGESTION] Allow registration of commands that point to subcommands
Description
I think it'd be nice if CommandAPI allowed you to register a command directly from a subcommand, say you have a gamemode command, and you also want to make a shortened version like /gmc, you could just register it as a command in the SubCommand, sort of the same concept as an alias.
Expected code
new CommandAPICommand("gamemode")
.withSubcommand(new CommandAPICommand("creative")
.withDirectCommand("gmc")
// stuff
Extra details
No response
withDirectCommand looks like it only supports a single direct command (withDirectCommand(String directCommand)).
I would suggest changing it to something plural and supporting multiple aliases,
e.g., withDirectAliases(String... directAliases).
It would also be nice if you could somehow specify a specific usage, etc.
withDirectCommandlooks like it only supports a single direct command (withDirectCommand(String directCommand)). I would suggest changing it to something plural and supporting multiple aliases, e.g.,withDirectAliases(String... directAliases).
I personally am not a fan of the name .withDirectAliases, i don't think it portrays the fact that its registering a command, and not an alias, if that makes sense
withDirectCommandlooks like it only supports a single direct command (withDirectCommand(String directCommand)). I would suggest changing it to something plural and supporting multiple aliases, e.g.,withDirectAliases(String... directAliases).I personally am not a fan of the name
.withDirectAliases, i don't think it portrays the fact that its registering a command, and not an alias, if that makes sense
I would prefer using 'aliases' since the term is already associated with commands. Although vanilla doesn't have aliases, the CommandAPI has created a dummy command as an alias, which I think fits quite well.
I personally do agree with @Timongcraft, the term "alias" fits quite well here as you're setting an alias for a certain command path.