| Crates.io | lighty-launcher |
| lib.rs | lighty-launcher |
| version | 0.8.6 |
| created_at | 2025-11-23 02:14:01.305425+00 |
| updated_at | 2025-12-14 07:30:38.4913+00 |
| description | A modern minecraft launcher library supporting multiple mod loaders fabric quilt, forge, neoforge, vanilla, and more |
| homepage | https://github.com/Lighty-Launcher/LightyLauncherLib |
| repository | https://github.com/Lighty-Launcher/LightyLauncherLib |
| max_upload_size | |
| id | 1946012 |
| size | 1,276,468 |
ACTIVE DEVELOPMENT - API may change between versions. Use with caution in production.
A modern, modular Minecraft launcher library for Rust with full async support, real-time event system, and automatic Java management.

auth, event, java, launch, loaders, version, core)Add to your Cargo.toml:
[dependencies]
lighty-launcher = { version = "0.6", features = ["vanilla", "events"] }
tokio = { version = "1", features = ["full"] }
directories = "6.0"
once_cell = "1.21"
tracing-subscriber = "0.3"
anyhow = "1.0"
use lighty_launcher::{
auth::{OfflineAuth, Authenticator},
java::JavaDistribution,
launch::Launch,
loaders::Loader,
version::VersionBuilder,
};
use directories::ProjectDirs;
use once_cell::sync::Lazy;
static LAUNCHER_DIR: Lazy<ProjectDirs> = Lazy::new(|| {
ProjectDirs::from("com", "MyLauncher", "")
.expect("Failed to create project directories")
});
#[tokio::main]
async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
// Authenticate
let mut auth = OfflineAuth::new("PlayerName");
let profile = auth.authenticate().await?;
// Create version instance
let mut version = VersionBuilder::new(
"vanilla-1.21.1",
Loader::Vanilla,
"",
"1.21.1",
&LAUNCHER_DIR
);
// Launch the game
version.launch(&profile, JavaDistribution::Temurin)
.run()
.await?;
Ok(())
}
For convenience, import commonly used types:
use lighty_launcher::prelude::*;
use directories::ProjectDirs;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let launcher_dir = ProjectDirs::from("com", "MyLauncher", "").unwrap();
let mut auth = OfflineAuth::new("Player");
let profile = auth.authenticate().await?;
let mut version = VersionBuilder::new(
"my-instance",
Loader::Vanilla,
"",
"1.21.1",
&launcher_dir
);
version.launch(&profile, JavaDistribution::Temurin)
.run()
.await?;
Ok(())
}
LightyLauncher is organized into logical modules, each with its own namespace:
lighty_launcher::auth - AuthenticationMultiple authentication methods with a unified, extensible interface:
use lighty_launcher::auth::{OfflineAuth, MicrosoftAuth, AzuriomAuth, Authenticator};
// Offline (no network required)
let mut auth = OfflineAuth::new("Player");
let profile = auth.authenticate().await?;
// Microsoft OAuth 2.0
let mut auth = MicrosoftAuth::new();
let profile = auth.authenticate().await?;
// Azuriom CMS
let mut auth = AzuriomAuth::new("https://example.com");
let profile = auth.authenticate().await?;
Custom Authentication:
Implement the Authenticator trait to create your own provider:
use lighty_launcher::auth::{Authenticator, UserProfile, UserRole, AuthResult};
pub struct MyCustomAuth {
api_url: String,
}
impl Authenticator for MyCustomAuth {
async fn authenticate(
&mut self,
#[cfg(feature = "events")] event_bus: Option<&EventBus>,
) -> AuthResult<UserProfile> {
// Your custom logic here
Ok(UserProfile {
username: "Player".to_string(),
uuid: "uuid-here".to_string(),
access_token: Some("token".to_string()),
role: UserRole::User,
})
}
}
Key Types:
OfflineAuth - Offline authentication (UUID v5 generation)MicrosoftAuth - Microsoft/Xbox Live OAuth 2.0AzuriomAuth - Azuriom CMS integrationAuthenticator - Trait for creating custom authentication providersUserProfile - User data (username, UUID, access token)generate_offline_uuid() - Helper to create deterministic UUIDslighty_launcher::event - Event SystemReal-time progress tracking for all launcher operations:
use lighty_launcher::event::{EventBus, Event, LaunchEvent, AuthEvent, JavaEvent};
// Create event bus
let event_bus = EventBus::new(1000);
let mut receiver = event_bus.subscribe();
// Listen to events
tokio::spawn(async move {
while let Ok(event) = receiver.next().await {
match event {
Event::Launch(LaunchEvent::InstallProgress { bytes }) => {
println!("Downloaded {} bytes", bytes);
}
Event::Java(JavaEvent::JavaDownloadStarted { distribution, version, total_bytes }) => {
println!("Downloading {} {} ({} MB)", distribution, version, total_bytes / 1_000_000);
}
_ => {}
}
}
});
// Use with authentication
let profile = auth.authenticate(Some(&event_bus)).await?;
// Use with launch
version.launch(&profile, JavaDistribution::Temurin)
.with_event_bus(&event_bus)
.run()
.await?;
Event Types:
AuthEvent - Authentication progressJavaEvent - JRE download/extractionLaunchEvent - Installation/launch progressLoaderEvent - Loader metadata fetchingCoreEvent - Archive extractionSee crates/event/README.md for complete documentation.
lighty_launcher::java - Java ManagementAutomatic Java runtime download and installation:
use lighty_launcher::java::{JavaDistribution, JavaRuntime};
// Distributions are automatically managed
JavaDistribution::Temurin // Recommended, supports all Java versions
JavaDistribution::GraalVM // High performance, Java 17+ only
JavaDistribution::Zulu // Enterprise support available
JavaDistribution::Liberica // Lightweight alternative
Supported Distributions:
| Distribution | Java Versions | Type | Size (Java 21) | Best For |
|---|---|---|---|---|
| Temurin | 8, 11, 17, 21+ | JRE | ~42 MB | General use, best compatibility |
| GraalVM | 17+ only | JDK | ~303 MB | Maximum performance |
| Zulu | 8, 11, 17, 21+ | JRE | ~82 MB | Enterprise support |
| Liberica | 8, 11, 17, 21+ | JRE | ~50 MB | Lightweight |
lighty_launcher::launch - Game LaunchingComplete launch orchestration with customization options:
use lighty_launcher::launch::{Launch, LaunchBuilder, DownloaderConfig, init_downloader_config};
use lighty_launcher::launch::keys::*;
// Configure downloader (optional)
init_downloader_config(DownloaderConfig {
max_concurrent_downloads: 100,
max_retries: 5,
initial_delay_ms: 50,
});
// Launch with custom JVM options and arguments
version.launch(&profile, JavaDistribution::Temurin)
.with_jvm_options()
.set("Xmx", "4G")
.set("Xms", "2G")
.done()
.with_arguments()
.set(KEY_LAUNCHER_NAME, "MyCustomLauncher")
.set("width", "1920")
.set("height", "1080")
.done()
.run()
.await?;
Key Features:
lighty_launcher::loaders - Mod LoadersSupport for multiple Minecraft mod loaders:
use lighty_launcher::loaders::{Loader, VersionInfo};
// Available loaders
Loader::Vanilla // Vanilla Minecraft
Loader::Fabric // Fabric mod loader
Loader::Quilt // Quilt mod loader
Loader::NeoForge // NeoForge (modern Forge fork)
Loader::Forge // Forge
Loader::LightyUpdater // Custom updater system
Loader::Optifine // OptiFine (experimental)
Loader Status:
| Loader | Status | Example Version | Minecraft Version |
|---|---|---|---|
| Vanilla | ✅ Stable | - | 1.21.1 |
| Fabric | ✅ Stable | 0.17.2 | 1.21.8 |
| Quilt | ✅ Stable | 0.17.10 | 1.18.2 |
| NeoForge | ⚠️ Testing | 20.2.93 | 1.20.2 |
| Forge | ⚠️ Testing | - | - |
| LightyUpdater | ✅ Stable | - | Custom |
| OptiFine | 🧪 Experimental | - | - |
lighty_launcher::version - Version BuildersBuild game instances with different loaders:
use lighty_launcher::version::{VersionBuilder, LightyVersionBuilder};
// Standard Minecraft with loader
let mut version = VersionBuilder::new(
"fabric-instance",
Loader::Fabric,
"0.17.2", // Loader version
"1.21.8", // Minecraft version
&launcher_dir
);
// LightyUpdater custom version
let mut version = LightyVersionBuilder::new(
"custom-instance",
"https://my-server.com/api",
&launcher_dir
);
lighty_launcher::core - Core UtilitiesLow-level utilities for system operations:
use lighty_launcher::core::{hash, extract, download, system};
// SHA1 verification
core::verify_file_sha1(&path, expected_hash).await?;
// Archive extraction
core::extract::zip_extract(reader, output_dir, None).await?;
// System detection
let (os, arch) = core::system::get_os_arch();
use lighty_launcher::{
auth::{OfflineAuth, Authenticator},
event::{EventBus, Event, LaunchEvent},
java::JavaDistribution,
launch::Launch,
loaders::Loader,
version::VersionBuilder,
};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let launcher_dir = ProjectDirs::from("com", "MyLauncher", "").unwrap();
// Create event bus
let event_bus = EventBus::new(1000);
let mut receiver = event_bus.subscribe();
// Spawn event listener
tokio::spawn(async move {
while let Ok(event) = receiver.next().await {
match event {
Event::Launch(LaunchEvent::InstallProgress { bytes }) => {
println!("Downloaded {} bytes", bytes);
}
Event::Launch(LaunchEvent::InstallCompleted { version, .. }) => {
println!("{} installation completed!", version);
}
_ => {}
}
}
});
// Authenticate with events
let mut auth = OfflineAuth::new("Player");
let profile = auth.authenticate(Some(&event_bus)).await?;
// Launch with events
let mut version = VersionBuilder::new(
"fabric-1.21.8",
Loader::Fabric,
"0.17.2",
"1.21.8",
&launcher_dir
);
version.launch(&profile, JavaDistribution::Temurin)
.with_event_bus(&event_bus)
.run()
.await?;
Ok(())
}
use lighty_launcher::auth::{MicrosoftAuth, Authenticator};
let mut auth = MicrosoftAuth::new();
// Interactive OAuth flow
let profile = auth.authenticate().await?;
println!("Logged in as: {}", profile.username);
println!("UUID: {}", profile.uuid);
use lighty_launcher::launch::{init_downloader_config, DownloaderConfig};
// Configure before launching
init_downloader_config(DownloaderConfig {
max_concurrent_downloads: 150, // More parallel downloads
max_retries: 10, // More retry attempts
initial_delay_ms: 100, // Longer initial delay
});
// Launches will use this configuration
version.launch(&profile, JavaDistribution::Temurin).run().await?;
Control which functionality is compiled:
# Minimal - Vanilla only
lighty-launcher = { version = "0.6", features = ["vanilla"] }
# With events
lighty-launcher = { version = "0.6", features = ["vanilla", "events"] }
# Multiple loaders
lighty-launcher = { version = "0.6", features = ["vanilla", "fabric", "quilt", "events"] }
# All loaders
lighty-launcher = { version = "0.6", features = ["all-loaders", "events"] }
# With Tauri integration
lighty-launcher = { version = "0.6", features = ["all-loaders", "events", "tauri-commands"] }
Available Features:
vanilla - Vanilla Minecraft support (required base)fabric - Fabric loaderquilt - Quilt loaderneoforge - NeoForge loaderforge - Forge loaderforge_legacy - Legacy Forge (1.7.10 - 1.12.2)lighty_updater - Custom updater systemall-loaders - All mod loadersevents - Event systemtauri-commands - Tauri desktop integration# Vanilla
cargo run --example vanilla --features vanilla,events
# Vanilla with events (detailed progress)
cargo run --example vanilla_with_events --features vanilla,events
# Fabric
cargo run --example fabric --features fabric
# Quilt
cargo run --example quilt --features quilt
# LightyUpdater
cargo run --example lighty_updater --features lighty_updater
lighty-launcher/
├── src/
│ └── lib.rs # Module organization and re-exports
│
├── crates/
│ ├── auth/ # Authentication
│ │ ├── offline.rs # Offline auth
│ │ ├── microsoft.rs # Microsoft OAuth
│ │ ├── azuriom.rs # Azuriom CMS
│ │ └── custom.rs # Custom endpoints
│ │
│ ├── event/ # Event system
│ │ ├── lib.rs # EventBus, EventReceiver
│ │ ├── errors.rs # Custom errors
│ │ └── module/ # Event definitions
│ │ ├── auth.rs # AuthEvent
│ │ ├── java.rs # JavaEvent
│ │ ├── launch.rs # LaunchEvent
│ │ ├── loader.rs # LoaderEvent
│ │ └── core.rs # CoreEvent
│ │
│ ├── java/ # Java runtime management
│ │ ├── distribution.rs # Distribution providers
│ │ ├── jre_downloader.rs # Download & install
│ │ └── runtime.rs # Version detection
│ │
│ ├── launch/ # Game launching
│ │ ├── arguments/ # Argument building
│ │ │ └── arguments.rs # Arguments trait
│ │ ├── installer/ # Installation logic
│ │ │ ├── installer.rs # Installer trait
│ │ │ ├── config.rs # Downloader config
│ │ │ ├── assets.rs # Asset management
│ │ │ ├── libraries.rs # Library management
│ │ │ ├── natives.rs # Native libraries
│ │ │ └── client.rs # Client JAR
│ │ └── launch/ # Launch orchestration
│ │ ├── runner.rs # Launch logic
│ │ ├── builder.rs # LaunchBuilder
│ │ └── config.rs # LaunchConfig
│ │
│ ├── loaders/ # Mod loaders
│ │ ├── vanilla/ # Vanilla Minecraft
│ │ ├── fabric/ # Fabric
│ │ ├── quilt/ # Quilt
│ │ ├── neoforge/ # NeoForge
│ │ ├── forge/ # Forge
│ │ ├── lighty_updater/ # Custom updater
│ │ └── utils/ # Caching & utilities
│ │
│ ├── version/ # Version builders
│ │ ├── version_builder.rs # Standard builder
│ │ └── lighty_builder.rs # LightyUpdater builder
│ │
│ └── core/ # Core utilities
│ ├── system.rs # OS/Arch detection
│ ├── hosts.rs # HTTP client
│ ├── download.rs # Download utilities
│ ├── extract.rs # Archive extraction
│ └── hash.rs # SHA1 verification
│
└── examples/ # Usage examples
├── vanilla.rs
├── vanilla_with_events.rs
├── fabric.rs
├── quilt.rs
├── neoforge.rs
└── lighty_updater.rs
dev: Fast compilation with opt-level=2 for dependenciesrelease: LTO thin, optimized for performancerelease-small: Size-optimized binary| Platform | Status | Architectures |
|---|---|---|
| Windows | ✅ Tested | x64, ARM64 |
| Linux | ✅ Tested | x64, ARM64 |
| macOS | ✅ Tested | x64 (Intel), ARM64 (Apple Silicon) |
LightyLauncher is composed of multiple focused crates:
lighty-auth - Authentication providerslighty-event - Event systemlighty-java - Java runtime managementlighty-launch - Game launchinglighty-loaders - Mod loader implementationslighty-version - Version builderslighty-core - Core utilitiesEach crate can be used independently or together through the main lighty-launcher crate.
This project is licensed under the MIT License - See LICENSE for details.
Clean Room Implementation: All components were implemented from scratch using only publicly documented APIs. No GPL-licensed code was used or referenced.
Made by Hamadi
Built with Rust: Tokio, Reqwest, Serde, Thiserror, and more.