0.1.0 • Published 1 year ago

minecraft-launcher-js v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Minecraft Launcher JS

Minecraft launcher wrapper for JavaScipt with modern Typings.

Example

import { MinecraftLauncher } from 'minecraft-launcher-js';

const launcher = new MinecraftLauncher({
    // 
    authentication: {
      name: 'Player',
    },
    memory: {
      max: 2048,
      min: 1024,
    },
    version: {
      number: '1.19.3',
      type: 'release',
    },
});

async function main() {
    // Prepare directories.
    launcher.prepare();

    // Download if any file is missing.
    await launcher.download();

    // Launch game.
    await launcher.start();
}

main();

Documentation

Launcher constructor parameters

ParameterTypeDescriptionRequired
assetsRootStringPath that will be used to load or download the game assets.False
authentication.accessTokenStringAccess token provided by an authentication flow.False
authentication.clientTokenStringClient token provided by an authentication flow.False
authentication.uuidStringUUID of the authenticated user (for online-mode: true)False
authentication.nameStringUsername of the authenticated userrTrue
authentication.meta.typeStringUser type (can be mojang or msa)False
authentication.meta.xuidStringUser xuidFalse
authentication.meta.clientIdStringApplication idFalse
brand.nameStringCustom launcher name, required if brand.version was specified.False
brand.versionStringCustom launcher version, required if brand.name was specified.False
envObjectEnv variables. By default the operating system will be used.False
features.is_demo_userBooleanLaunch the game in demo mode.False
features.has_custom_resolutionBooleanLaunch the game using resolution from window settings (see below)False
fixLog4JExploitBooleanIn versions less than 1.17 it will disable Log4j lookup functions.False
gameRootStringPath to be used to load game data (Default %appdata%.minecraft)False
jarFileStringJar file of the version (Default versions/{ver}/{ver}.jar)False
javaPathStringJava binary path. By default it will try to get the system one.False
jsonFileStringJson file of the version (Default versions/{ver}/{ver}.json)False
libraryRootStringPath that will be used to load or download the game libraries.False
memory.maxNumberMaximum ram memory of the instance.True
memory.minNumberMinimum ram memory of the instance.True
nativesRootStringPath that will be used to load or download the game natives.False
osStringOperating system. By default it will try to detect.False
version.numberStringVersion to be launched, for example 1.19.3.True
version.typeStringVersion type to be launched, value can be relase or snapshot.True
versionRootStringPath that will be used to load or download the game versions.False
window.heightNumberThe height of the window if has_custom_resolution is activated.False
window.widthNumberThe width of the window if has_custom_resolution is activated.False
urls.metaStringURL from where the manifests will be obtained.False
urls.resourcesStringURL from where the resources will be obtained.False
urls.librariesStringURL from where the libraries will be obtained.False
0.1.0

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago