Introduction
LiquidBounce features a powerful scripting system that allows you to extend the client with custom modules, commands, and functionality at runtime. Scripts can be written in various languages supported by GraalVM’s polyglot engine.Supported Languages
LiquidBounce uses GraalVM’s polyglot engine to support multiple scripting languages:- JavaScript (ES2023) - Primary supported language with Nashorn compatibility
- Python (via GraalPy)
- Ruby (via TruffleRuby)
- Other GraalVM-supported languages
JavaScript is the recommended language for LiquidBounce scripts, with the most examples and community support.
Script Location
Scripts are stored in thescripts directory within your LiquidBounce folder:
Script Organization
You can organize scripts in two ways:Single File Script
Single File Script
Place your script file directly in the
scripts directory:Directory-Based Script
Directory-Based Script
Create a directory and place a This allows you to:
main file inside:- Use CommonJS
require()to import other files - Organize complex scripts with multiple files
- Bundle resources with your script
Basic Script Structure
Every LiquidBounce script must register itself using theregisterScript function:
Required Properties
The display name of your script
Semantic version of your script (e.g., “1.0.0”)
Script author(s) - can be a single string or an array
Script Lifecycle Events
Scripts can hook into lifecycle events using thescript.on() method:
Available Lifecycle Events
Triggered when the script is first loaded from disk
Triggered when the script is enabled (modules/commands registered)
Triggered when the script is disabled (modules/commands unregistered)
Complete Example
Here’s a complete minimal script:Loading Scripts
Scripts are automatically loaded on client startup!
CommonJS Support
For JavaScript scripts, CommonJS module loading is enabled:Next Steps
Creating Modules
Learn how to create custom modules with scripts
Creating Commands
Build custom commands for the command system
Working with Events
Handle game events in your scripts
API Reference
Explore the complete Script API
Troubleshooting
Script not loading
Script not loading
- Verify the script file is in the correct directory
- Check that
registerScript()is called with all required fields - Look for errors in the console log
- Ensure the file extension matches a supported language (
.js,.py, etc.)
Syntax errors
Syntax errors
- Check your JavaScript syntax
- For JavaScript, ECMAScript 2023 features are supported
- Use Nashorn-compatible syntax if needed
Missing features
Missing features
- Ensure you’re using the correct API methods (see API Reference)
- Check that the client version supports the feature you’re trying to use