Open jomo opened 9 years ago
New Event URL: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerCommandPreprocessEvent.html
There is no such CommandExecutor event btw?
BTW: Console won't be able to use commands if we use the event up there ^
there is, link fixed.
Well now its not an event, its a CommandHandler but yeah that'll do :P I guess a command is still an event.
Wtf xD
It would be great to have a single class that listens to the [
onCommand
](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/command/CommandExecutor.html#onCommand%28org.bukkit.command.CommandSender, org.bukkit.command.Command, java.lang.String, java.lang.String[]%29) event and then calls our internal command methods (instead of creating tons of listeners for each command).This would also allow us to throw our own error classes which we could catch, e.g:
NoPermissionError
InvalidArgsError
NotPlayerError
This would save us stuff like
instead we would do something like