Skip to content

Basic Implementation

Consler edited this page Sep 19, 2026 · 2 revisions

Basic Implementation

A quick-start guide to installing, authenticating, and launching Minecraft instances.


1. Installation

MinecraftInstaller handles downloading and setting up game files in a specified directory.

Fabric Installation

String version = "26.2";
Path gameDirectory = Path.of("/home/user/MinecraftDirectory/26.2-fabric");
ModLoaderProfile loaderProfile = new ModLoaderProfile(ModLoaderProfile.FABRIC_ID, "0.19.5");

new MinecraftInstaller().install(version, gameDirectory, loaderProfile);

Vanilla Installation

String version = "1.16.1";
Path gameDirectory = Path.of("/home/user/MinecraftDirectory/26.2-vanilla");
ModLoaderProfile loaderProfile = ModLoaderProfile.VANILLA();

new MinecraftInstaller().install(version, gameDirectory, loaderProfile);

2. Authentication

Create an AuthProfile to represent the player's session.

Offline (Cracked)

AuthProfile authProfile = AuthProfile.Offline("Player");

With Microsoft (JavaFX WebView)

AuthProfile authProfile = new MicrosoftAuthenticator().login(new WebViewFrame()).join(); 

3. Launching

How to actually launch Minecraft

version = "26.2";
gameDirectory = Path.of("/home/user/MinecraftDirectory/26.2-fabric");
ModLoaderProfile loaderProfile = new ModLoaderProfile(ModLoaderProfile.FABRIC_ID, "0.19.5");

// if authProfile was loaded from a save file
authProfile = new MicrosoftAuthenticator().refreshIfNeeded(authProfile);

LaunchProfile launchProfile = LaunchProfile.Builder(version, gameDirectory).build();