Events

Overview

lighty-launch emits LaunchEvent types through the event bus system provided by lighty-event. These events track the launch process and instance lifecycle.

Feature: Requires events feature flag

Export:

  • Event types: lighty_event::LaunchEvent

  • Re-export: lighty_launcher::event::LaunchEvent

LaunchEvent Types

DownloadingAssets

Emitted during asset download progress.

Fields:

  • current: usize - Number of assets downloaded

  • total: usize - Total number of assets to download

When emitted: During asset installation

Example:

Event::Launch(LaunchEvent::DownloadingAssets { current, total }) => {
    let progress = (current as f64 / total as f64) * 100.0;
    println!("Assets: {}/{} ({:.1}%)", current, total, progress);
}

DownloadingLibraries

Emitted during library download progress.

Fields:

  • current: usize - Number of libraries downloaded

  • total: usize - Total number of libraries to download

When emitted: During library installation

Example:

DownloadingNatives

Emitted during native library download progress.

Fields:

  • current: usize - Number of natives downloaded

  • total: usize - Total number of natives to download

When emitted: During native library installation

Example:

DownloadingMods

Emitted during mod download progress.

Fields:

  • current: usize - Number of mods downloaded

  • total: usize - Total number of mods to download

When emitted: During mod installation (for loaders with mod metadata)

Example:

InstanceLaunched

Emitted when Minecraft process starts successfully.

Fields:

  • instance_name: String - Name of the launched instance

  • pid: u32 - Process ID

When emitted: After game process spawns

Example:

ConsoleOutput

Emitted for each line of console output (stdout/stderr).

Fields:

  • pid: u32 - Process ID

  • line: String - Console output line

When emitted: Real-time as game outputs to console

Example:

InstanceExited

Emitted when game process exits.

Fields:

  • pid: u32 - Process ID

  • exit_code: Option<i32> - Exit code (None if killed)

When emitted: After game process terminates

Example:

InstanceDeleted

Emitted when instance is deleted from disk.

Fields:

  • instance_name: String - Name of deleted instance

When emitted: After delete_instance() completes

Example:

Complete Event Flow

Launch Process

Instance Deletion

Complete Example

Last updated