SpongeAPI icon indicating copy to clipboard operation
SpongeAPI copied to clipboard

Add way to customise message if a typed command is invalid

Open dualspiral opened this issue 5 years ago • 3 comments

This arose from discussion with @Faithcaio - basically the exception messages returned from commands that aren't parsed correctly is... bad.

Currently, if you type in a command and it doesn't parse correctly, it states that it is an unknown command. Plugin developers might want return a better message that might display the usage (as an example) if their command is called incorrectly.

I will likely want to add a way to attach a UnknownCommandHandler (name pending) on the Command.Builder object that gets the partial command context and command string - but I do need to think about this a little more.

dualspiral avatar Aug 28 '20 19:08 dualspiral

@dualspiral Is this fixed by https://github.com/SpongePowered/SpongeAPI/pull/2296 and ValueParameterModifier#modifyExceptionMessage ?

ImMorpheus avatar Apr 04 '21 16:04 ImMorpheus

Not at all.

dualspiral avatar Apr 04 '21 18:04 dualspiral

I think this would be really useful

reflqct avatar Nov 21 '21 07:11 reflqct