Overview
TheBladeConfiguration class contains all configuration options for customizing how Blade behaves. You configure these settings using the config() method on the Blade builder.
Configuration Properties
verbose
Whether Blade should log verbose output including detailed information like command registration. Type:booleanDefault:
false
overrideCommands
Whether Blade should override vanilla/existing commands when registering commands with the same name. For example, if you register a command namedwhitelist, the vanilla /whitelist command will be overridden if this option is enabled.
Type: booleanDefault:
false
commandQualifier
The qualifier used to register commands. Most platforms (Bukkit, Velocity, etc.) prefix commands with the plugin name. For example, with a qualifier ofmyplugin, commands can be accessed as /myplugin:command in addition to /command.
Type: StringDefault: Your plugin’s name
defaultPermissionMessage
The default permission message sent to users when they don’t have permission to execute a command. This can be overridden on a per-command basis using the@Permission annotation.
Type: StringDefault:
"You don't have permission to perform this command."
executionTimeWarningThreshold
The execution time threshold (in milliseconds) after which a warning is logged when a command takes too long to execute on the main thread. This helps identify performance issues with synchronous commands. Type:longDefault:
25L (25 milliseconds)
strictArgumentCount
Whether Blade should strictly enforce the argument count when executing commands. When enabled (default), if a user provides more arguments than a command expects, Blade will reject the command execution and inform the user about the incorrect argument count. Type:booleanDefault:
true
lenientFlagMatching
Whether Blade should strictly match flags when parsing command arguments.- Disabled (default): Any unknown flags encountered will be parsed as standard arguments. This also applies to BSD-style flags, e.g.,
-abwill be parsed as an argument if either-aor-bare unknown. - Enabled: Unknown flags will simply be ignored during parsing.
booleanDefault:
false
strictFlagCount
Whether Blade should strictly enforce that each flag is only provided once. When enabled (default), if a user provides the same flag multiple times, Blade will reject the command execution and inform the user about the duplicate flags. Type:booleanDefault:
true
asyncExecutor
The executor used for running asynchronous commands (commands annotated with@Async).
By default, Blade uses a cached thread pool with daemon threads.
Type: Consumer<Runnable>Default: Cached thread pool executor
tabCompleter
The tab completer used for providing command completions. By default, a platform-specific implementation is used. Type:TabCompleterDefault:
TabCompleter.Default
helpGenerator
The help generator used for generating help messages for commands. Type:HelpGenerator<Text>Default:
HelpGenerator.Default
feedbackCreator
The creator used for generating command feedback messages (usage and help). Type:CommandFeedbackCreator<Text>Default:
CommandFeedbackCreator.Default
logger
The logger Blade uses to log messages, warnings, and errors. Type:BladeLoggerDefault:
BladeLogger.DEFAULT
helpSorter
The comparator used to sort commands in help messages. By default, commands are sorted alphabetically by their main label. Type:Comparator<BladeCommand>Default: Alphabetical by main label
Configuration Example
Here’s a comprehensive example showing common configuration options:Platform-Specific Configuration
Some platforms may provide additional configuration options. Check your platform’s documentation for platform-specific settings.Validation
Blade automatically validates configuration when building. The following must be set:commandQualifier(cannot be null)helpGenerator(cannot be null)tabCompleter(cannot be null)
See Also
- Blade - Main Blade class
- Builder - Builder pattern and configuration flow
- Getting Started - Quick start guide