LiteCommands icon indicating copy to clipboard operation
LiteCommands copied to clipboard

Add support for the permission requirement for flags

Open WhyZerVellasskx opened this issue 10 months ago • 3 comments

Hello, can you please implement @FlagPermission("flag_name", "permission.for.this.flag") this will be quite useful, for example, if you make the /kill command and that the player cannot use /kill --forced if there is no right.

WhyZerVellasskx avatar Jan 31 '25 18:01 WhyZerVellasskx

my idea: maybe @Flag(flag = "--force", permission = "command.flag.force")


temponary solution: just create another command definition's:

@Command(name = "kill --force) @Permission("permission")

Important: Using your (or my idea) idea makes the commands definition execute(context, arg1, arg2, arg3, flag, flag, flag, flag, [...]) harder to read.

vLuckyyy avatar Jan 31 '25 19:01 vLuckyyy

Yes, that's true, but it's still better to use flag for such moments, but it's a pity that you can't add permission for the flag. I liked your idea. I hope they can implement it.

WhyZerVellasskx avatar Jan 31 '25 22:01 WhyZerVellasskx

my idea:

@Flag("-flag") @Permission("some.permission") boolean flag

Rollczi avatar Feb 02 '25 20:02 Rollczi