Skip to main content

Overview

Client API commands handle game launching, build management, mod installation, and data persistence. These commands are split across three files:
  • src-tauri/src/app/gui/commands/client.rs - Client launching and API interactions
  • src-tauri/src/app/gui/commands/data.rs - Data management
  • src-tauri/src/app/gui/commands/system.rs - System information

Client Launching

run_client

Launch the Minecraft client with LiquidBounce. This command handles the entire launch process including downloading assets, libraries, and starting the game.
#[tauri::command]
pub(crate) async fn run_client(
    client: Client,
    build_id: u32,
    options: Options,
    mods: Vec<LoaderMod>,
    window: Window,
    app_state: tauri::State<'_, AppState>,
) -> Result<(), String>
client
Client
required
The LiquidBounce API client instance
build_id
number
required
The build ID to launch (obtained from request_builds)
options
Options
required
Launcher options including account, memory, JVM args, etc.
mods
LoaderMod[]
required
Array of mods to load with the client
window
Window
required
Tauri window instance (automatically passed)
app_state
AppState
required
Application state (automatically passed)
result
void
Returns nothing on successful launch start. The game runs in a separate thread.
Events Emitted:
progress-update
ProgressUpdate
Emitted during launch preparation with progress information
process-output
string
Game console output (stdout and stderr)
client-error
void
Emitted when the client crashes or fails to start
client-exited
void
Emitted when the client exits normally
Returns an error if the client is already running: "client is already running"

terminate

Terminate the currently running Minecraft client.
#[tauri::command]
pub(crate) async fn terminate(app_state: tauri::State<'_, AppState>) -> Result<(), String>
result
void
Returns nothing. Sends SIGTERM to the running client process.
Does nothing if no client is currently running.

Build Management

request_branches

Retrieve all available LiquidBounce branches from the API.
#[tauri::command]
pub(crate) async fn request_branches(client: Client) -> Result<Branches, String>
client
Client
required
The LiquidBounce API client instance
Branches
object
This command uses exponential backoff retry logic for reliability.

request_builds

Retrieve builds for a specific branch.
#[tauri::command]
pub(crate) async fn request_builds(
    client: Client,
    branch: &str,
    release: bool
) -> Result<Vec<Build>, String>
client
Client
required
The LiquidBounce API client instance
branch
string
required
The branch name (e.g., “nextgen”, “legacy”)
release
boolean
required
If true, only return release builds. If false, return all builds.
Build[]
array
Array of build objects

fetch_changelog

Fetch the changelog for a specific build.
#[tauri::command]
pub(crate) async fn fetch_changelog(
    client: Client,
    build_id: u32
) -> Result<Changelog, String>
client
Client
required
The LiquidBounce API client instance
build_id
number
required
The build ID
Changelog
object

Blog & News

fetch_blog_posts

Fetch blog posts from the LiquidBounce blog with pagination.
#[tauri::command]
pub(crate) async fn fetch_blog_posts(
    client: Client,
    page: u32
) -> Result<PaginatedResponse<BlogPost>, String>
client
Client
required
The LiquidBounce API client instance
page
number
required
Page number (1-indexed)
PaginatedResponse
object

Mod Management

request_mods

Retrieve available mods for a specific Minecraft version and subsystem.
#[tauri::command]
pub(crate) async fn request_mods(
    client: Client,
    mc_version: &str,
    subsystem: &str,
) -> Result<Vec<LoaderMod>, String>
client
Client
required
The LiquidBounce API client instance
mc_version
string
required
Minecraft version (e.g., “1.20.1”)
subsystem
string
required
Mod loader (“fabric” or “forge”)
LoaderMod[]
array
Array of available mods

get_custom_mods

Get custom mods installed for a specific branch and Minecraft version.
#[tauri::command]
pub(crate) async fn get_custom_mods(
    branch: &str,
    mc_version: &str,
) -> Result<Vec<LoaderMod>, String>
branch
string
required
Branch name
mc_version
string
required
Minecraft version
LoaderMod[]
array
Array of custom mods (with source type “local”)

install_custom_mod

Install a custom mod from a file path.
#[tauri::command]
pub(crate) async fn install_custom_mod(
    branch: &str,
    mc_version: &str,
    path: PathBuf,
) -> Result<(), String>
branch
string
required
Branch name
mc_version
string
required
Minecraft version
path
string
required
Absolute path to the JAR file
result
void
Returns nothing on success. The file is copied to the custom mods directory.

delete_custom_mod

Delete a custom mod.
#[tauri::command]
pub(crate) async fn delete_custom_mod(
    branch: &str,
    mc_version: &str,
    mod_name: &str,
) -> Result<(), String>
branch
string
required
Branch name
mc_version
string
required
Minecraft version
mod_name
string
required
Mod file name (including .jar extension)
result
void
Returns nothing on success

Data Commands

get_options

Retrieve the current launcher options from disk.
#[tauri::command]
pub(crate) async fn get_options() -> Result<Options, String>
Options
object
Complete launcher configuration (see run_client for structure)

store_options

Save launcher options to disk.
#[tauri::command]
pub(crate) async fn store_options(options: Options) -> Result<(), String>
options
Options
required
The options object to save

clear_data

Delete cached game data (assets, libraries, etc.).
#[tauri::command]
pub(crate) async fn clear_data(options: Options) -> Result<(), String>
options
Options
required
Options to determine the data directory location
This permanently deletes:
  • assets
  • gameDir
  • libraries
  • mod_cache
  • natives
  • runtimes
  • versions

default_data_folder_path

Get the default data folder path for this platform.
#[tauri::command]
pub(crate) async fn default_data_folder_path() -> Result<String, String>
path
string
Absolute path to the default data directory

System Commands

get_launcher_version

Get the current launcher version.
#[tauri::command]
pub(crate) async fn get_launcher_version() -> Result<String, String>
version
string
Launcher version string (e.g., “2.0.0”)

sys_memory

Get system memory in megabytes.
#[tauri::command]
pub(crate) fn sys_memory() -> u64
memory
number
Total system memory in megabytes

setup_client

Initialize the LiquidBounce API client with a session token.
#[tauri::command]
pub(crate) async fn setup_client(session_token: String) -> Result<Client, String>
session_token
string
required
Session token for API authentication
Client
object
Initialized API client instance
This command automatically finds the first available API endpoint using fallback logic.

check_system

Perform system checks before launching (Windows only).
#[tauri::command]
pub(crate) async fn check_system() -> Result<(), String>
result
void
Returns nothing on success
On Windows, this checks the hosts file for potential issues. On other platforms, this is a no-op.

Source Code

  • Client commands: src-tauri/src/app/gui/commands/client.rs:1
  • Data commands: src-tauri/src/app/gui/commands/data.rs:1
  • System commands: src-tauri/src/app/gui/commands/system.rs:1

Build docs developers (and LLMs) love