Overview
The LiquidBounce Script API provides a comprehensive set of utilities, bindings, and helpers for creating powerful scripts. This reference documents all available APIs.Global Bindings
These objects and functions are available globally in all scripts:Core Functions
Registers your script with LiquidBounce.Source:
PolyglotScript.kt:77 (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/PolyglotScript.kt:77)Client API
Main client API hub providing access to managers and utilities.Source:
ScriptClient.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptClient.kt)Display a message in the client chat.
Access and manage modules.
Access command system.
Access the event system.
Minecraft Instance
Direct access to the Minecraft client instance.Source:
ScriptContextProvider.kt:59 (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptContextProvider.kt:59)Setting Builder
Create module settings/values.Available types:
Setting.boolean(config)- Boolean valueSetting.int(config)- Integer with rangeSetting.float(config)- Float with rangeSetting.intRange(config)- Integer rangeSetting.floatRange(config)- Float rangeSetting.text(config)- Text inputSetting.choose(config)- Single choiceSetting.multiChoose(config)- Multiple choicesSetting.key(config)- Key binding
ScriptSetting.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/features/ScriptSetting.kt)Utility APIs
These utility objects provide helper functions:RotationUtil
Rotation and aiming utilities.Source:
ScriptRotationUtil.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptRotationUtil.kt)Creates a rotation targeting the center of an entity’s bounding box.Parameters:
entity: Entity- Target entity
Rotation - Rotation objectPerformance: Very fast (no raytracing)Creates an optimal rotation using raytracing.Parameters:
entity: Entity- Target entityrange: number- Maximum rangethroughWallsRange: number- Range through walls
Rotation | null - Best rotation or null if no valid spotPerformance: Slower (uses raytracing)Aims at a rotation using the rotation manager.Parameters:
rotation: Rotation- Target rotationfixVelocity: boolean- Whether to apply movement correction
ItemUtil
Item and inventory utilities.Source:
ScriptItemUtil.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptItemUtil.kt)NetworkUtil
Network packet utilities.Source:
ScriptNetworkUtil.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptNetworkUtil.kt)MovementUtil
Player movement utilities.Source:
ScriptMovementUtil.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptMovementUtil.kt)BlockUtil
Block and world utilities.Source:
ScriptBlockUtil.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptBlockUtil.kt)InteractionUtil
Player interaction utilities.Source:
ScriptInteractionUtil.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptInteractionUtil.kt)ReflectionUtil
Java reflection utilities for advanced usage.Source:
ScriptReflectionUtil.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptReflectionUtil.kt)Minecraft Classes
These Minecraft classes are available for direct use:3D vector with doubles.
3D vector with integers.
Block position in the world.
Player hand enumeration.
Math utilities.
Advanced Features
Local Storage
Persistent storage across script reloads (within same session).Source:
ScriptContextProvider.kt:38 (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptContextProvider.kt:38)Async Utilities (JavaScript)
Async/Promise utilities for JavaScript.Source:
ScriptAsyncUtil.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptAsyncUtil.kt)Thread Management
Thread creation utilities.Source:
ScriptUnsafeThread.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptUnsafeThread.kt)Parameter Validation
Helpers for validating command parameters.Source:
ScriptParameterValidator.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptParameterValidator.kt)Script Object Methods
The script object returned byregisterScript() provides these methods:
Register global script lifecycle events.Source:
PolyglotScript.kt:286 (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/PolyglotScript.kt:286)Type Support
Primitives
Java primitive type helpers.Source:
ScriptPrimitives.kt (~/workspace/source/src/main/kotlin/net/ccbluex/liquidbounce/script/bindings/api/ScriptPrimitives.kt)Best Practices
Type Safety
Type Safety
Always check types before operations:
Error Handling
Error Handling
Wrap API calls in try-catch:
Performance
Performance
Cache frequently accessed values:
Main Thread Access
Main Thread Access
Always use
mc.execute() for thread-safe operations:Complete API Example
Next Steps
Getting Started
Learn the basics of scripting
Creating Modules
Build custom modules
Working with Events
Handle game events
Creating Commands
Build custom commands