Closed itsrenderman closed 1 year ago
Guard methods are checked before hooks
Out of curiosity can you explain why you decided to do it this way?
Guard methods are checked before hooks
Out of curiosity can you explain why you decided to do it this way?
I interpreted the initial proposal with the idea that guards should have a higher potency on the outcome of command execution over hooks
Hey, thanks for the contribution. We've discussed this internally and think that hooks should run before guards, this is because hooks are more 'generic'. For instance, if a player lacks the permissions to run a command, that is more important than an argument needing to have a player whose character health is above 0.
Are you willing to make this adjustment yourself? If not, that's completely fine since I can do it.
Quickly changed this on phone, should be good now 👍
Closes #86
Guard methods are checked before hooks.
When a guard method is called, the first parameter is the command context.
The dispatcher also supports sending additional parameters as varargs (similar to hooks), though this is not used in standard command execution.
If the guard method returns a non-nil value, the command will be interrupted and the value printed to the window.
Example usage: