Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CCBlueX/LiquidBounce/llms.txt
Use this file to discover all available pages before exploring further.
Overview
LiquidBounce’s script system allows you to extend the client with custom functionality using various programming languages. Built on GraalVM Polyglot, the system supports JavaScript, Python, Ruby, R, and more, enabling you to create modules, commands, and event handlers without recompiling the client.Scripts are stored in the
scripts/ directory and loaded automatically on client startupScript Manager
TheScriptManager handles all script lifecycle operations including loading, enabling, disabling, and unloading scripts.
Source:
script/ScriptManager.kt:40-198Supported Languages
The script system uses GraalVM’s polyglot engine to support multiple languages:The engine automatically detects the language from file extension (
.js, .py, .rb, etc.)Script Structure
Scripts can be organized in two ways:- Single File
- Directory with Main
Place a script file directly in the Each file is loaded as a separate script.
scripts/ folder:Reference:
ScriptManager.kt:74-102Script API
The Script API provides access to LiquidBounce’s internal systems through bindings:Available Bindings
Client Context (ScriptContextProvider)
Client Context (ScriptContextProvider)
Access Minecraft client instances and game state:Source:
script/bindings/api/ScriptContextProvider.ktModule System (ScriptModule)
Module System (ScriptModule)
Create custom modules with settings and event handlers:Source:
script/bindings/features/ScriptModule.kt:40-77Command System (ScriptCommandBuilder)
Command System (ScriptCommandBuilder)
Register custom commands:Source:
script/bindings/features/ScriptCommandBuilder.ktUtilities
Utilities
Helper functions for common operations:
- ScriptMovementUtil - Player movement helpers
- ScriptRotationUtil - Rotation calculations
- ScriptBlockUtil - Block interaction utilities
- ScriptItemUtil - Item manipulation
- ScriptNetworkUtil - Network packet handling
- ScriptInteractionUtil - Entity interaction
Async Operations (ScriptAsyncUtil)
Async Operations (ScriptAsyncUtil)
Schedule tasks on the game thread:Source:
script/bindings/api/ScriptAsyncUtil.ktCreating Script Modules
Here’s a complete example of a script module:Event System
Scripts can listen to game events using the event system:- Common Events
- Combat Events
- Module Events
See
event/EVENT_NAME_TO_CLASS in source for all available eventsScript Lifecycle
Scripts follow a defined lifecycle managed by the ScriptManager:Initialization
The script engine is initialized with GraalVM polyglot support:Reference:
ScriptManager.kt:58-68Enabling
Loaded scripts are enabled, registering their modules and commands:Reference:
ScriptManager.kt:163-170Managing Scripts
Use the script command to manage loaded scripts:Best Practices
Use Main Files
Organize complex scripts in directories with a
main entry pointHandle Errors
Wrap event handlers in try-catch to prevent script crashes
Clean Up Resources
Always clean up in the
disable event handlerTest Thoroughly
Test scripts in single-player before using on servers
Use Settings
Make scripts configurable with the value system
Document Code
Add comments and descriptions for maintainability
Marketplace Integration
Scripts can be distributed through the LiquidBounce Marketplace:Reference:
ScriptManager.kt:78-80Debugging Scripts
Enable debug options for script development:Next Steps
Module System
Understand the module architecture
Command System
Learn about command creation
Script Examples
Explore complete script examples
API Reference
Complete scripting API documentation