Skip to content
🚧 This project and documentation is under construction and may be inaccurate. Packages and APIS may not be ready or available. 🚧

Launch Builder

This tool is in charge of building the launch script and creating the log file.

Most projects will not need this tool directly. startGame calls it for you.

Info: For Information on Launch Arguments go here

This injects the log location into the logging config so each session has its own log file (sessionLogs/<sessionID>/mcLogs.log). The result is written to .temp/log_config.xml.

It takes the following parameters:

  • logFile: Path of the original log file.
  • sessionID: Current Session ID

buildJVMRules (manifest, libraryList, versionData, overrides)

Section titled “buildJVMRules (manifest, libraryList, versionData, overrides)”

This functions builds the Java half of the launch command.

The parameters are:

  • manifest: The version spec (found at specPath in the CE Object)
  • libraryList: List of library paths (libList in the CE Object)
  • versionData: An object containing the game version, e.g. { "version": "1.20.1" }
  • overrides: JVM overrides. Click here for information on overrides.

Returns an array of JVM arguments.

buildGameRules (manifest, loggedUser, overrides)

Section titled “buildGameRules (manifest, loggedUser, overrides)”

This functions builds the Game half of the launch command.

It takes the following parameters:

  • manifest: The version spec (found at specPath in the CE Object)
  • loggedUser: Authentication data. See Auth Info for the accepted formats.
  • overrides: Game overrides. Click here for information on overrides.

Returns an array of game arguments.

buildFile (manifest, jreVersion, jvmRules, gameRules)

Section titled “buildFile (manifest, jreVersion, jvmRules, gameRules)”

This function builds the complete launch command and writes it to a file ready for launch.

It takes the following parameters:

  • manifest: The version spec
  • jreVersion: jreVersion in the CE Object
  • jvmRules: The data created from the buildJVMRules function
  • gameRules: The data created from the buildGameRules function

The script is written to .temp/launch.sh (Linux / macOS) or .temp/launch.bat (Windows) and its path is returned.

On macOS each argument is written on its own line (-cp <path> and --flag <value> pairs are kept together) and arguments containing spaces or special characters are quoted. Linux uses java and Windows uses javaw.

As well as the variables in the version spec, the following are filled in when building the arguments:

Variable Used In Value
${natives_directory} JVM .temp in the Cauldron folder
${assets_root} JVM assets in the Cauldron folder
${profile_name} Game Minecraft
${resolution_width} Game 854
${resolution_height} Game 480

buildLaunchScript (manifest, jreVersion, sessionName)

Section titled “buildLaunchScript (manifest, jreVersion, sessionName)”

This function builds a launch script for a dedicated server.

It takes the following parameters:

  • manifest: The server version spec
  • jreVersion: JVM Version Name
  • sessionName: Folder name of the server in servers/

The server is started with 4GB of RAM and Aikar’s Flags. The script is written to scripts/launch-server.sh (Linux / macOS) or scripts/launch-server.bat (Windows) and its path is returned.