Pierce01 / MinecraftLauncher-core

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

Authenticator issues #17

Closed ThatBlockyPenguin closed 5 years ago

ThatBlockyPenguin commented 5 years ago

Hello! I have recently found this project, but whenever I try to launch minecraft using it, I get this error:

[MCLC]: Parsed version from version manifest
[MCLC]: Set native path to C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\minecraft\natives\1.14
[MCLC]: Attempting to download Minecraft version jar
C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\minecraft-launcher-core\components\authenticator.js:36
                throw new Error("Validation error: " + response.statusMessage);
                ^

Error: Validation error: Forbidden
    at Request._callback (C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\minecraft-launcher-core\components\authenticator.js:36:23)
    at Request.self.callback (C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\request\request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\request\request.js:1161:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (C:\Users\PixelOrangeDev\Documents\Programming\NodeJS\MeteorMC\node_modules\request\request.js:1083:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)

My lauchMinecraft file contains this:

const { Client, Authenticator } = require('minecraft-launcher-core');

let opts = {
    clientPackage: null,
    authorization: Authenticator.getAuth("BlockyPenguin", "**My Password**"),
    root: "./minecraft",
    os: "windows",
    version: {
        number: "1.14",
        type: "release"
    },
    memory: {
        max: "6000",
        min: "4000"
    }
}

const launcher = new Client();
launcher.launch(opts);

launcher.on('debug', (e) => console.log(e));
launcher.on('data', (e) => console.log(e.toString('utf-8')));
launcher.on('error', (e) => console.log(e.toString('utf-8')));

Can anyone help me please? thank you!

Pierce01 commented 5 years ago

This error is caused by using an incorrect email/username and password.

instead of using your username, use your email. Username is only for unmigrated accounts

ThatBlockyPenguin commented 5 years ago

Ah, ok. Thanks @Pierce01!