-
Notifications
You must be signed in to change notification settings - Fork 0
Basic Implementation
Consler edited this page Sep 19, 2026
·
2 revisions
A quick-start guide to installing, authenticating, and launching Minecraft instances.
MinecraftInstaller handles downloading and setting up game files in a specified directory.
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);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);Create an AuthProfile to represent the player's session.
AuthProfile authProfile = AuthProfile.Offline("Player");AuthProfile authProfile = new MicrosoftAuthenticator().login(new WebViewFrame()).join(); 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();