classSource
public class Launcher

Constructors

public Launcher()

Methods

public static void launchMinecraft(User user, LaunchConfiguration launchConfig)
Downloads required files and launches Minecraft. Can be used in offline mode, will throw OfflineModeNeedsNetworkException if any assets, libraries or other stuff is not downloaded but needed
Parameters
userUserThe logged-in user to launch with, or null to launch in offline mode(you won't be able to join online servers or use any online features in offline mode)
launchConfigLaunchConfigurationConfiguration used by the launcher when starting the game, such as the number of download threads, launcher name, and launcher version

Example:

LaunchConfiguration config = new LaunchConfiguration.Builder()
.downloadThreads(10)
.launcherName("MinifiedLauncher")
.launcherVersion("1.0.0")
.assetsDirectory(Path.of("path to assets directory"))
.librariesDirectory(Path.of("path to library directory"))
.jarFile(Path.of("path to client.jar"))
.build();

Nested types