Skip to main content

Global Objects

registerScript()

Registers a script with LiquidBounce. Must be called in every script.
registerScript({
    name: "ScriptName",      // Required: Script display name
    version: "1.0.0",        // Required: Script version
    authors: ["Author"]      // Required: String or array of authors
});

Client

Provides access to LiquidBounce’s core systems.
// Display a message in chat
Client.displayChatMessage(message: string)

// Access managers
Client.moduleManager    // ModuleManager instance
Client.commandManager   // CommandManager instance
Client.eventManager     // EventManager instance
Client.configSystem     // ConfigSystem instance
Client.scriptManager    // ScriptManager instance
Client.combatManager    // CombatManager instance

mc

Direct access to the Minecraft client instance.
mc.player         // Local player (can be null)
mc.level          // Current world (can be null)
mc.gameMode       // Game mode controller
mc.options        // Game options/settings
mc.getConnection() // Network connection

localStorage

Session-persistent key-value storage shared across all scripts.
localStorage["key"] = value;  // Store
const value = localStorage["key"]; // Retrieve

Setting

Factory for creating module settings. See Custom Modules for usage.

Boolean Setting

Setting.boolean({
    name: "enabled",
    default: true
})

Integer Setting

Setting.int({
    name: "delay",
    default: 100,
    range: [0, 1000],
    suffix: "ms"
})

Float Setting

Setting.float({
    name: "range",
    default: 4.2,
    range: [1.0, 6.0],
    suffix: "blocks"
})

Integer Range Setting

Setting.intRange({
    name: "delay",
    default: [50, 100],
    range: [0, 500],
    suffix: "ms"
})

Float Range Setting

Setting.floatRange({
    name: "range",
    default: [3.0, 4.5],
    range: [1.0, 6.0],
    suffix: "blocks"
})

Text Setting

Setting.text({
    name: "message",
    default: "Hello World"
})

Text Array Setting

Setting.textArray({
    name: "messages",
    default: ["msg1", "msg2"]
})

Choice Setting

Setting.choose({
    name: "mode",
    choices: ["Single", "Multi", "Switch"],
    default: "Single"
})

Multi-Choice Setting

Setting.multiChoose({
    name: "targets",
    choices: ["Players", "Mobs", "Animals"],
    default: ["Players", "Mobs"],
    canBeNone: false
})

Key Binding Setting

Setting.key({
    name: "bind",
    default: "NONE"  // Key name from InputConstants
})

Utility Objects

RotationUtil

Utilities for managing player rotations and aiming.
// Create rotation to entity's bounding box center (fast)
const rotation = RotationUtil.newRotationEntity(entity);

// Create raytraced rotation to entity (accurate but slower)
const rotation = RotationUtil.newRaytracedRotationEntity(
    entity,
    range: 4.2,
    throughWallsRange: 0.0
);

// Apply rotation
RotationUtil.aimAtRotation(
    rotation,
    fixVelocity: true  // Enable movement correction
);

MovementUtil

Player movement utilities.
// Get player's horizontal speed
const speed = MovementUtil.getSpeed();

// Check if player is moving
const moving = MovementUtil.isMoving();

// Strafe
MovementUtil.strafe();  // Default strafe
MovementUtil.strafeWithSpeed(speed);
MovementUtil.strafeWithStrength(strength);
MovementUtil.strafeWithSpeedAndStrength(speed, strength);

ItemUtil

Item creation utilities.
// Create item from string
const item = ItemUtil.create("minecraft:diamond_sword");

// Create item with count
const items = ItemUtil.create("minecraft:golden_apple", 64);

NetworkUtil

Network packet utilities (requires injection in bindings).
// Send packet to server
NetworkUtil.sendPacket(packet);

InteractionUtil

Utilities for world interaction.

BlockUtil

Block-related utilities.

ReflectionUtil

Java reflection utilities for accessing private fields and methods.

ParameterValidator

Utilities for validating command parameters.
ParameterValidator.validate(input, requirements);

UnsafeThread

Thread utilities for running code asynchronously.

Primitives

Java primitive type wrappers for interop.

AsyncUtil (JavaScript only)

Promise-based async utilities for JavaScript.
// Available in JavaScript scripts
AsyncUtil.promise(executor);

Minecraft API Classes

Direct access to Minecraft classes:
Vec3i          // Integer vector (x, y, z)
Vec3d          // Double vector (x, y, z)
BlockPos       // Block position
MathHelper     // Math utilities (Mth class)
Hand           // InteractionHand enum
RotationAxis   // Axis enum for rotations

Using Minecraft Classes

// Create a BlockPos
const pos = new BlockPos(x, y, z);

// Create a Vec3
const vec = new Vec3d(x, y, z);

// Use MathHelper
const clamped = MathHelper.clamp(value, min, max);

Module Manager

Access and control modules.
const moduleManager = Client.moduleManager;

// Get a module
const killAura = moduleManager.getModule("KillAura");

// Enable/disable
killAura.enabled = true;
killAura.enabled = false;

// Access settings
const range = killAura.settings.range;
range.value = 4.5;

// Get all modules
const modules = moduleManager.modules;

Event Manager

Access to the event system.
const eventManager = Client.eventManager;

// Events are typically registered on modules/commands
// See Custom Modules section for event usage

Common Events

These events can be used in modules and modes:

Player Events

  • playerTick - Called every player tick
  • playerMove - Called when player moves
  • playerJump - Called when player jumps
  • healthUpdate - Called when health changes
  • death - Called when player dies

Game Events

  • gameRender - Called during game rendering
  • worldRender - Called during world rendering
  • overlayRender - Called during overlay rendering

Network Events

  • packetSend - Called when sending a packet
  • packetReceive - Called when receiving a packet

World Events

  • blockBreak - Called when breaking a block
  • blockPlace - Called when placing a block

Window Events

  • keyboardKey - Called on keyboard input
  • mouseButton - Called on mouse button input
See event files in source code for complete list and parameters:
  • event/events/PlayerEvents.kt
  • event/events/GameEvents.kt
  • event/events/NetworkEvents.kt
  • event/events/WorldEvents.kt

Type Reference

When working with the API, these are common types you’ll encounter:

Event Objects

Event objects are passed to event handlers and may have properties you can read or modify:
module.on("playerMove", (event) => {
    // event.movement - Vec3 of movement
    // Modify the movement
    event.movement = new Vec3d(0, event.movement.y, 0);
});

Cancellable Events

Some events can be cancelled:
module.on("packetSend", (event) => {
    // Cancel the packet
    event.cancelEvent();
});

Working with Java Objects

Since LiquidBounce is written in Kotlin/Java, you’ll often work with Java objects:
// Accessing Java methods
const player = mc.player;
const health = player.getHealth();

// Java getters/setters can be accessed as properties in JavaScript
const name = player.name;  // Calls getName()

// Calling methods with parameters
player.setPos(x, y, z);

// Working with Java collections
const entities = mc.level.entities();
entities.forEach((entity) => {
    // Process entity
});
GraalVM provides excellent interoperability between JavaScript and Java. You can call Java methods naturally from JavaScript.

Build docs developers (and LLMs) love