LiquidBounceAddon

Declared under the liquidbounce entrypoint in fabric.mod.json:

"entrypoints": { "liquidbounce": ["com.example.addon.ExampleAddon"] }

Register through the register* helpers, not ModuleManager directly, so a failing add-on can be rolled back.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard

Registered for all add-ons before any onInitialize runs.

Link copied to clipboard
Link copied to clipboard
open override val debugDisplayName: FormattedCharSequence
Link copied to clipboard
open override val debugOwnerId: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val EventListener.eventListenerScope: CoroutineScope

Get the related CoroutineScope of receiver EventListener.

Link copied to clipboard
open val gpuDevice: GpuDevice
Link copied to clipboard
val id: String
Link copied to clipboard
open val inGame: Boolean
Link copied to clipboard
open val interaction: MultiPlayerGameMode
Link copied to clipboard
val logger: Logger
Link copied to clipboard
open val mc: Minecraft
Link copied to clipboard
Link copied to clipboard
open val network: ClientPacketListener
Link copied to clipboard
open val player: LocalPlayer
Link copied to clipboard
open override val running: Boolean

Returns whether the listenable is running or not, this is based on the parent listenable and if no parent is present, it will return the opposite of isDestructed.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val world: ClientLevel

Functions

Link copied to clipboard
open fun after(ticks: Int, task: Runnable): AutoCloseable

Runs task once, ticks game ticks from now, unless this listener stops running first.

Link copied to clipboard
Link copied to clipboard
inline fun <E : Event, V> EventListener.computedOn(initialValue: V, priority: Short = 0, crossinline accumulator: (event: E, prev: V) -> V): ReadWriteProperty<EventListener, V>

Returns computed ReadWriteProperty based on the accumulator of specific event.

Link copied to clipboard
fun config(name: String = id, tree: MutableCollection<out ValueGroup> = mutableListOf()): Config
Link copied to clipboard
open override fun <T : Event> EventListener.createEventHook(eventClass: Class<T>, wrappedContext: CoroutineContext, priority: Short, handler: SuspendableEventHandler<T>): EventHook<T>
open override fun <T : Event> EventListener.createEventHook(eventClass: Class<T>, wrappedContext: CoroutineContext, priority: Short, handler: SuspendableEventHandler<T>): EventHook<T>
Link copied to clipboard
inline fun DebuggedOwner.debugGeometry(name: String, lazyGeometry: () -> ModuleDebug.DebuggedGeometry?)
Link copied to clipboard
inline fun DebuggedOwner.debugParameter(name: String, lazyValue: () -> Any?)
Link copied to clipboard
@JvmName(name = "create")
fun <T : Entity> EventListener.EntityLookup(collector: EntityLookup.Collector<T>): EntityLookup<T>
Link copied to clipboard
open fun every(ticks: Int, task: Runnable): AutoCloseable

Runs task every ticks game ticks while this listener is running, the first time after ticks.

Link copied to clipboard
Link copied to clipboard
inline fun <T : Event> EventListener.handler(priority: Short = 0, handler: Consumer<T>): EventHook<T>
fun <T : Event> EventListener.handler(eventClass: Class<T>, priority: Short = 0, handler: Consumer<T>): EventHook<T>
Link copied to clipboard
inline fun <E : Event> EventListener.newEventHook(priority: Short = 0, handler: Consumer<E>): EventHook<E>
Link copied to clipboard
open fun <E : Event> on(type: Class<E>, handler: Consumer<E>): AutoCloseable

open fun <E : Event> on(type: Class<E>, priority: Short, handler: Consumer<E>): AutoCloseable

Calls handler for every type event while this listener is running. Higher priority runs first. Close the result to stop early; unregister does the same for all of them.

Link copied to clipboard
inline fun <T : Event> EventListener.once(priority: Short = 0, crossinline handler: (T) -> Unit): EventHook<T>
Link copied to clipboard
abstract fun onInitialize()

Runs before configs are loaded, so only what is registered here gets its settings restored.

Link copied to clipboard
open fun onStarted()

Runs once configs are loaded.

Link copied to clipboard
open fun onStopping()

Runs before configs are written back to disk.

Link copied to clipboard
open fun onTick(task: Runnable): AutoCloseable

task every game tick while this listener is running.

Link copied to clipboard
Link copied to clipboard

Offers a browser backend the player can choose when the client starts.

Link copied to clipboard

For categories that are only known once the add-on runs. Declare the rest in categories.

Link copied to clipboard
Link copied to clipboard
fun registerCommandNodes(nodes: Collection<LiteralCommandNode<ClientCommandSource>>)
Link copied to clipboard
fun registerListeners(vararg listeners: EventListener)

Only tracks listeners for rollback; modules and modes are tracked already.

Link copied to clipboard

Takes over subscribed marketplace items of type; handler runs once the subscriptions are loaded at startup and after every install, update or removal of one.

Link copied to clipboard
fun <T : Mode> registerMode(parent: ModeValueGroup<T>, mode: T)
Link copied to clipboard
fun registerModules(vararg modules: ClientModule)
Link copied to clipboard

Offers quickFix on the fatal error screen for the errors it matches.

Link copied to clipboard

Remove cached scope and cancel it.

Link copied to clipboard
inline fun <T : Event> EventListener.repeated(times: Int = 1, priority: Short = 1, crossinline handler: (T) -> Unit): EventHook<T>
Link copied to clipboard
inline fun <T : Event> EventListener.sequenceHandler(priority: Short = 0, dispatcher: CoroutineDispatcher? = null, onCancellation: Runnable? = null, crossinline eventHandler: SuspendableEventHandler<T>): EventHook<T>

Registers an event hook for events of type T and launches a sequence

Link copied to clipboard
inline fun <T : Event> EventListener.suspendHandler(context: CoroutineContext = EmptyCoroutineContext, priority: Short = 0, behavior: SuspendHandlerBehavior = SuspendHandlerBehavior.Parallel.Default, noinline handler: SuspendableEventHandler<T>): EventHook<T>

Start a Job on event.

Link copied to clipboard
inline fun EventListener.tickHandler(dispatcher: CoroutineDispatcher? = null, onCancellation: Runnable? = null, crossinline eventHandler: suspend CoroutineScope.() -> Unit): EventHook<GameTickEvent>

Registers a repeatable sequence which repeats the execution of code on GameTickEvent.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open fun unregister()

Unregisters the event handler from the manager. This decision is FINAL! After the class was unregistered we cannot restore the handlers.

Link copied to clipboard
fun unregisterModules(vararg modules: ClientModule)
Link copied to clipboard
inline fun <T : Event> EventListener.until(priority: Short = 0, crossinline handler: (T) -> Boolean): EventHook<T>
Link copied to clipboard
inline suspend fun <T : Event> EventListener.waitMatches(priority: Short = 0, predicate: Predicate<T>): T

Wait an event of type T which matches given predicate.

suspend fun <T : Event> EventListener.waitMatches(eventClass: Class<T>, priority: Short, predicate: Predicate<T>): T
Link copied to clipboard
inline suspend fun <T : Event> EventListener.waitMatchesWithTimeout(timeout: Duration, priority: Short = 0, predicate: Predicate<T>): T?

Wait an event of type T which matches given predicate. If the timeout is exceeded, return null.

Link copied to clipboard

Wrap the original interceptor and make it auto-detect the listener's running state at suspension to determine whether to resume the continuation.