Despical / CommandFramework

A lightweight annotation based command system
https://spigotmc.org/resources/89933
GNU General Public License v3.0
23 stars 5 forks source link

Execute a not-existing subcommand. #7

Closed gamerover98 closed 1 year ago

gamerover98 commented 1 year ago

Description of Issue & Steps to Reproduce

Imagine an /example command with first and second subcommands. When executing /example third no message is sent back to the sender.

Command Framework Version

1.2.1

Server Version

1.20.1

Additional Information

Should send to the sender the usage property of the @Command annotation.

    @Command(
            name = "example",
            aliases = {"exp"},
            desc = "An example command",
            usage = "/example bla bla bla"
    )
Despical commented 1 year ago

It's not handled by default but you can define a consumer using CommandFramework#setAnyMatch(CommandArguments) method to run when that happens.

If you're looking for a working example take a look at here.

gamerover98 commented 1 year ago

That's fine! But, you can send the usage string if no one CommandFramework#setAnyMatch(CommandArguments) method is called by default. Currently, the command does nothing.