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
Functions
Section titled “Functions”logInjector (logFile, sessionID)
Section titled “logInjector (logFile, sessionID)”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 atspecPathin the CE Object)libraryList: List of library paths (libListin 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 atspecPathin 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 specjreVersion:jreVersionin the CE ObjectjvmRules: The data created from the buildJVMRules functiongameRules: 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.
Launch Variables
Section titled “Launch Variables”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 specjreVersion: JVM Version NamesessionName: Folder name of the server inservers/
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.
