@Sender
Marks a parameter as the command sender.Sender parameters don’t consume command arguments. They’re automatically populated with the command executor.
Custom Sender Types
You can register custom sender types usingSenderProvider:
@Name
Sets the display name for a parameter.The parameter name shown in usage messages and errors.
Without
@Name, Blade uses the compiled bytecode parameter name (like arg0, arg1) unless you compile with the -parameters flag.@Opt
Marks a parameter as optional with configurable default values.The type of default value:
EMPTY_OR_CUSTOM- UseEMPTYorCUSTOMbased on whether custom value is providedEMPTY- Usenull(or primitive default like0,false)SENDER- Use the command sender as default (for player types)CUSTOM- Use the value fromcustom()field
Custom default value when
value = Type.CUSTOM. Parsed according to parameter type.If true, parsing errors result in an empty value instead of failing command execution.
@Flag
Creates a command flag that can be specified with-f or --flagName.
Single character for short flag format (
-f).Long flag name for
--flagName format.Description shown in help messages.
Whether the flag must be present.
@Greedy
Consumes all remaining arguments into a single string.@Range
Validates that numeric parameters fall within a specified range.Minimum allowed value (inclusive).
NaN means no minimum.Maximum allowed value (inclusive).
NaN means no maximum.Works with all numeric types:
int, long, float, double, and their wrapper classes.@Provider
Overrides the argument provider for a specific parameter.The custom argument provider class to use.
What to override:
PARSER- Override only argument parsingSUGGESTIONS- Override only tab completionBOTH- Override both parsing and suggestions
@Data
Passes custom string data to an argument provider’s methods.Array of strings passed to the argument provider.
For type-safe metadata, consider creating a custom annotation marked with
@Forwarded instead of using string-based @Data.