You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
defwhatever_command(sender, args):
ifnotis_player(sender):
msg(sender, "&cOnly players can do this")
returnTruewhatever()
deffoobar_command(sender, args):
ifnotis_player(sender):
msg(sender, "&cOnly players can do this")
returnTruefoobar()
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:
NoPermissionErrorInvalidArgsErrorNotPlayerErrorThis would save us stuff like
instead we would do something like