Pierce01 / MinecraftLauncher-core

Lightweight module that downloads and runs Minecraft using javascript / NodeJS
MIT License
356 stars 81 forks source link

How run "offline" account? #122

Closed zaralX closed 6 months ago

zaralX commented 6 months ago

I couldn’t find how to launch the game offline without Authenticator.getAuth("username", "password") in launch, please write how to solve this.

const launcher = new Client();
let opts = {
    // For production launchers, I recommend not passing
    // the getAuth function through the authorization field and instead
    // handling authentication outside before you initialize
    // MCLC, so you can handle auth based errors and validation!
    authorization: Authenticator.getAuth("username", "password"),
    root: "minecraft",
    javaPath: "C:\\Program Files\\Java\\jdk1.8.0_333\\bin\\java.exe",
    version: {
        number: "1.8.9",
        type: "release"
    },
    memory: {
        max: "4G",
        min: "1G"
    }
}
launcher.launch();
launcher.on('debug', (e) => console.log(e));
launcher.on('data', (e) => console.log(e));
TheReal-Flo commented 6 months ago

No support for offline auth

Pierce01 commented 6 months ago

Only pass the username parameter in getAuth