Skip to main content

Overview

LiquidBounce provides a comprehensive event system with events for game ticks, player actions, network packets, rendering, and more. All events extend the base Event class.

Event Categories

Game Events

Core game loop and timing events.

GameTickEvent

Fired every game tick (20 times per second).
val handler = handler<GameTickEvent> {
    // Executes every tick
}

GameRenderEvent

Fired during game rendering.

TickPacketProcessEvent

Fired during packet processing phase.

Player Events

Events related to player actions and movement.

PlayerTickEvent

Fired during player tick (cancellable).
val handler = handler<PlayerTickEvent> { event ->
    if (shouldCancel) {
        event.cancelEvent()
    }
}

PlayerMoveEvent

Fired when the player moves. Properties:
  • type: MoverType - The type of movement
  • movement: Vec3 - The movement vector (modifiable)

PlayerJumpEvent

Fired when the player jumps (cancellable). Properties:
  • motion: Float - Jump motion (modifiable)
  • yaw: Float - Jump direction (modifiable)

PlayerStepEvent

Fired during step-up mechanics. Properties:
  • height: Float - Step height (modifiable)

PlayerSafeWalkEvent

Controls safe walk (prevents falling off edges). Properties:
  • isSafeWalk: Boolean - Enable/disable safe walk

Network Events

Events related to network packets.

PacketEvent

Fired for all incoming and outgoing packets (cancellable). Properties:
  • origin: TransferOrigin - SEND or RECEIVE
  • packet: Packet<*> - The packet instance
  • original: Boolean - Whether this is the original packet
val handler = handler<PacketEvent> { event ->
    when (event.packet) {
        is ServerboundMovePlayerPacket -> {
            // Handle movement packet
        }
    }
}

BlinkPacketEvent

Fired when packets are queued by blink features.

Input Events

User input events.

KeyEvent

Fired when a key is pressed or released. Properties:
  • key: InputConstants.Key - The key that was pressed
  • action: Int - PRESS, RELEASE, or REPEAT

MouseButtonEvent

Fired for mouse button events.

MouseRotationEvent

Fired when the player rotates the camera (cancellable). Properties:
  • cursorDeltaX: Double - Horizontal rotation delta
  • cursorDeltaY: Double - Vertical rotation delta

MovementInputEvent

Fired when processing movement input. Properties:
  • directionalInput: DirectionalInput - Forward/backward/left/right
  • jump: Boolean - Jump input
  • sneak: Boolean - Sneak input

Combat Events

AttackEntityEvent

Fired when attacking an entity (cancellable).
val handler = handler<AttackEntityEvent> { event ->
    val target = event.entity
    // Custom attack logic
}

TargetChangeEvent

Fired when the combat target changes.

RotationUpdateEvent

Fired when rotations should be updated.

Render Events

WorldRenderEvent

Fired during world rendering.

OverlayRenderEvent

Fired during overlay rendering.

ScreenRenderEvent

Fired when rendering GUI screens.

DrawOutlinesEvent

Fired when entity outlines should be drawn.

World Events

WorldChangeEvent

Fired when changing worlds/servers.

ChunkLoadEvent

Fired when a chunk is loaded.

ChunkUnloadEvent

Fired when a chunk is unloaded.

BlockChangeEvent

Fired when a block changes.

Client Events

ClientStartEvent

Fired when the client starts.

ClientShutdownEvent

Fired when the client shuts down.

SessionEvent

Fired when the session changes. Properties:
  • session: User - The new session

DisconnectEvent

Fired when disconnecting from a server.

ServerConnectEvent

Fired when connecting to a server (cancellable).

Module Events

ModuleToggleEvent

Fired when a module is toggled.

ModuleActivationEvent

Fired during module activation.

ValueChangedEvent

Fired when a module value changes.

Chat Events

ChatSendEvent

Fired when sending a chat message (cancellable). Properties:
  • message: String - The message being sent
val handler = handler<ChatSendEvent> { event ->
    if (event.message.startsWith("/")) {
        // Handle command
        event.cancelEvent()
    }
}

ChatReceiveEvent

Fired when receiving a chat message (cancellable). Properties:
  • message: String - The message text
  • textData: Component - Raw message component
  • type: ChatType - CHAT_MESSAGE, DISGUISED_CHAT_MESSAGE, or GAME_MESSAGE

Inventory Events

ScheduleInventoryActionEvent

Fired to schedule inventory actions.

SelectHotbarSlotSilentlyEvent

Fired for silent hotbar slot selection.

ClientPlayerInventoryEvent

Fired when the player inventory changes.

Entity Events

EntityHealthUpdateEvent

Fired when an entity’s health updates.

EntityMarginEvent

Fired to modify entity collision margins.

EntityEquipmentChangeEvent

Fired when entity equipment changes.

Block Events

BlockShapeEvent

Fired to modify block shapes.

BlockVelocityMultiplierEvent

Fired to modify block velocity multipliers.

BlockSlipperinessMultiplierEvent

Fired to modify block slipperiness.

BlockBreakingProgressEvent

Fired during block breaking.

Event Properties

Cancellable Events

Many events extend CancellableEvent and can be cancelled:
val handler = handler<AttackEntityEvent> { event ->
    event.cancelEvent() // Prevents the attack
}

Event State

Some events have a state property:
  • PRE - Before the action
  • POST - After the action
val handler = handler<PlayerNetworkMovementTickEvent> { event ->
    when (event.state) {
        EventState.PRE -> { /* Before movement */ }
        EventState.POST -> { /* After movement */ }
    }
}

Creating Event Handlers

Using handler Function

val myHandler = handler<GameTickEvent> { event ->
    // Handle event
}

With Priority

val myHandler = handler<PacketEvent>(
    priority = EventPriorityConvention.FIRST_PRIORITY
) { event ->
    // High priority handler
}

One-time Handlers

val handler = handler<GameTickEvent> { event ->
    // This will execute once then unregister
    unregister()
}

See Also

Build docs developers (and LLMs) love