Overview
LiquidBounce’s command system provides a powerful way to interact with the client through chat commands. Commands support auto-completion, parameter validation, subcommands, and custom aliases.By default, the command prefix is
. - you can change this in the command settingsCommand Manager
TheCommandManager is the central registry for all commands. It handles command registration, execution, parsing, and auto-completion.
Source:
features/command/CommandManager.kt:97-117Command Categories
Commands are organized into logical categories based on their functionality:- Client Commands
- In-Game Commands
- Module Commands
- Creative Commands
Control core client features and settings
- friend - Manage your friends list
- toggle - Enable/disable modules
- bind - Assign keybinds to modules
- config - Load and save configurations
- script - Manage custom scripts
- hide - Hide/show modules from the HUD
- panic - Emergency disable all modules
- value - Modify module settings
Registered in
CommandManager.kt:124-170Command Architecture
Command Structure
Commands are built using theCommandBuilder DSL:
Subcommands
Commands can have nested subcommands for complex operations:The
hub() modifier indicates the command only routes to subcommandsReal Example: Friend Command
The Friend command demonstrates a complete command with multiple subcommands:Source:
features/command/commands/client/CommandFriend.kt:52-100Command Execution
TheCommandManager.execute() method handles the complete command lifecycle:
Tokenization
The input string is parsed into tokens, respecting quotes and escapes:Reference:
CommandManager.kt:398-451Command Resolution
The command tree is traversed to find the matching command and subcommands:Reference:
CommandManager.kt:208-228Parameter Validation
Each parameter is validated and parsed according to its type:Reference:
CommandManager.kt:368-389Parameter Types
Commands support various parameter types with built-in validation:- String Parameters
- Integer Parameters
- Player Name Parameters
- Enum Parameters
- Vararg Parameters
Auto-Completion
The command system provides intelligent auto-completion:Source:
CommandManager.kt:453-514Auto-completion supports:
- Command names and aliases
- Subcommand suggestions
- Parameter value hints
- Player name completion
- Module name completion
Error Handling
The command system provides helpful error messages with suggestions:Creating Custom Commands
You can register custom commands at runtime:Command Reference
.friend <add|remove|alias|list|clear>
.friend <add|remove|alias|list|clear>
Manage your friends listSubcommands:
add <name> [alias]- Add a friendremove <name>- Remove a friendalias <name> <alias>- Set friend aliaslist- Show all friendsclear- Remove all friends
.friend add Notch "Best Miner".toggle <module> [on|off]
.toggle <module> [on|off]
Enable or disable a moduleParameters:
module- Module name (auto-completes)on|off- Optional state (toggles if omitted)
.toggle KillAura on.bind <module> <key>
.bind <module> <key>
Bind a module to a keyboard keyParameters:
module- Module namekey- Key name or code
.bind Fly R.config <load|save|list|delete>
.config <load|save|list|delete>
Manage configuration filesSubcommands:
load <name>- Load a configsave <name>- Save current configlist- Show all configsdelete <name>- Delete a config
.config save hypixel.panic
.panic
Emergency disable all modulesExample:
.panicBest Practices
Use Descriptive Names
Choose clear, intuitive command names that describe their function
Provide Aliases
Add short aliases for frequently used commands
Validate Input
Always use parameter validators to ensure correct input
Handle Errors
Throw CommandException with helpful messages on failures
Next Steps
Modules
Learn about the module system
Scripts
Create commands via scripting
API Reference
Complete command API documentation
Examples
Build your own commands