Disable command error messages

I want to create my own commandsystem with custom error messages. How can I disable the vanilla error reports (not enough arguments, unknown subcommand etc.) ?

Here’s how I handle it

https://github.com/trentech/ProjectWorlds/tree/master/src/com/gmail/trentech/pjw/commands

To elaborate, I handle all arguments as generic strings. As for child commands, I don’t know if there is any way around the built in system

1 Like

Is there a way to override too many/not enough arguments?

For full control, use the CommandCallable interface instead of CommandSpec (see docs).

One drawback is that you have to implement the argument parsing.

1 Like

Hey… I use commandcallable and my command parsing is awesome.

Granted it requires a lot of boilerplate…

I’m going with CommandCallable aswell now. It’s easier for me to create my own system, than to understand someone else’s.

How did you make the suggestions?

Is there a way to use the existing command system in sponge from a command callable without registering the command spec with sponge?

This would likely allow you to still use sponges argument parsing and tab suggest, but since it delegates through events and your command callable, you would have full control over the eventual output?

That doesn’t make sense, since sponge is parsing input for you, it’s also going to be the one that encounters the error.

If you don’t like the way that sponge does command parsing, the only other choice is to do it yourself.

You could register your own command callable, in there you delegate to the command spec and catch the exceptions.

That’s what I’m doing now.