Introduction
LiquidBounce’s command system allows scripts to add custom commands that can be executed from the in-game chat. Commands support parameters, subcommands, auto-completion, and validation.Basic Command
Here’s a simple command:SimpleCommand.js
.hello or .hi or .greet
Command Structure
Command Parameters
Add parameters to your commands:ParameterCommand.js
.setvalue 100 or .setvalue 100 "Hello World"
Parameter Properties
Vararg Parameters
Accept multiple values for a parameter:.broadcast This is a long message
Parameter Validation
Validate parameters before execution:ValidatedCommand.js
Auto-Completion
Provide suggestions for parameters:AutoCompleteCommand.js
Subcommands
Create commands with subcommands:SubcommandExample.js
.config save.config load.config reset yes
Complete Command Example
Here’s a comprehensive command example:ModuleControl.js
.module toggle KillAura- Toggle a module.module list Combat- List modules by category.module info KillAura- Show module info
Accessing Command Arguments
TheonExecute handler receives parameters in order:
Error Handling
Handle errors in command execution:Best Practices
- Descriptive names - Use clear, intuitive command names
- Aliases - Provide short aliases for frequently used commands
- Auto-completion - Implement completions for better UX
- Validation - Validate inputs to prevent errors
- Error messages - Show helpful error messages
- Help text - Consider adding a help subcommand
- Null checks - Always check for null before using game objects
Next Steps
- Examples - See complete command examples
- API Reference - Full API documentation
- Custom Modules - Create custom modules