Client Controller
This controller allows for a game client to be installed or launched onto the target system. It replaces the
launcher controller from earlier versions.
Functions
Section titled “Functions”installGame (version, loaderInfo)
Section titled “installGame (version, loaderInfo)”Parameters:
version: Game Version (e.g.1.20.1)loaderInfo: An object describing the loader. See here. (Defaults to{ type: 'vanilla' })
This function gathers everything required for the selected version (using getCEObject) and then verifies / downloads the client jar, JVM, assets, libraries and logging config through the queue.
If the loader is not supported, an error is logged and the install falls back to vanilla.
Any patches that match the version and operating system are applied before installing.
The function will return the CE Object for the installation.
startGame (version, loaderInfo, authInfo, overrides)
Section titled “startGame (version, loaderInfo, authInfo, overrides)”Parameters:
version: Game VersionloaderInfo: An object describing the loader. See here.authInfo: Authentication Data for the logged-in user. See here.overrides: JVM and Game argument overrides. See here. (Optional)
This function will:
- Install the game using installGame
- Create a session ID and inject it into the logging config
- Extract natives into
.tempin the Cauldron folder - Run any loader post processors (e.g. Forge / NeoForge)
- Build the launch script (see Launch Builder)
- Spawn the game as a detached process
The function finishes when the boot process starts. It will return the session ID.
If the version has no logging config, the session ID will be
DETACH.
The .temp folder is removed automatically once the game closes.
Examples
Section titled “Examples”Example, Launching a 1.7.10 vanilla client with no overrides
const { startGame } = require('@jackcooperdev/cauldronengine/client');
const sessionID = await startGame('1.7.10', { type: 'vanilla' }, authData);// Returns SessionIDExample, Launching a 1.20.1 forge client with a specific loader version and overrides
const sessionID = await startGame('1.20.1', { type: 'forge', version: '47.3.0' }, authData, { jvm: { launcher_name: 'CauldronMC', ram: '8' }, game: { game_directory: '/home/user/.cauldron/instances/my-pack' }});// Returns SessionIDExample, Installing a 1.21.1 neoforge client without launching
const { installGame } = require('@jackcooperdev/cauldronengine/client');
const ceObject = await installGame('1.21.1', { type: 'neoforge' });// Returns CE ObjectAppendix
Section titled “Appendix”Loader Info
Section titled “Loader Info”{ "type": "forge", "version": "47.3.0"}type: One ofvanilla,forge,fabricorneoforgeversion: (Non-Vanilla Only) Exact loader version to use. Defaults torelease(the recommended loader version)
Auth Info
Section titled “Auth Info”For Information on how to retrieve this data, check out the Cauldron Authentication plugin.
authInfo can be supplied in one of three forms.
Account Object
{ "token": "MINECRAFT_ACCESS_TOKEN", "accountData": { "xuid": "2535400000000000", "sub": "00000000-0000-0000-0000-000000000000", "pfd": [ { "id": "069a79f444e94726a5befca90e38aaf5", "name": "Notch" } ] }}Access Token String
The Minecraft access token (JWT) as a string. The username, UUID, XUID and client ID are decoded from the token.
Demo
{ "demo": true }Launches with a placeholder Demo user.
Overrides
Section titled “Overrides”Overrides (or flag overrides) are changes made to how Minecraft boots. There are two types of override, game and
jvm.
Example of an override object
{ "game": { "version_type": "CauldronMC", "game_directory": "C:\\Users\\User\\AppData\\Roaming\\.cauldron\\instances\\my-pack", "server_ip": "play.example.com" }, "jvm": { "launcher_name": "CauldronMC", "ram": "8", "ram_low": "4" }}jvm overrides:
| Key | Description | Default |
|---|---|---|
launcher_name |
Launcher name passed to Java | CauldronEngine |
ram |
Maximum RAM (GB) | 8 |
ram_low |
Minimum RAM (GB) | 4 |
game overrides:
| Key | Description |
|---|---|
game_directory |
Directory the game runs in. Also used as the working directory |
version_type |
Version type shown on the title screen |
server_ip |
Joins this server on launch (--quickPlayMultiplayer / --server) |
username |
Overrides the player name |
uuid |
Overrides the player UUID |
For A full list of arguments click here
Patches
Section titled “Patches”Some versions are swapped to a different loader on certain systems so that they can run.
| Patch | Versions | Operating System | Change |
|---|---|---|---|
ornithe_patch |
b1.7 to 1.2.5 | mac-os-arm64 |
Loader is set to ornithe |
