PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
5.12k stars 922 forks source link

Mineflayer Throwing Error without Context #2483

Closed ultimatehecker closed 2 years ago

ultimatehecker commented 2 years ago

Versions

Detailed description of a problem

I have been trying for a couple days to log on to my server with my alt account but it was continuously telling me that my credentials were wrong. I switched over to a Microsoft account and did all the setup for that and I get this random error that doesn't give me any context about the problem

What did you try yet?

I have tried to reset my packages, which I was hoping would bring up the Microsoft prompt again, but I have failed ever since

Did you try any method from the API? Just the authorizing of creating a client and a simple prismarine-viewer script

Did you try any example? Any error from those? Not as I have tested

Your current code:

main.js


    const minecraft = mineflayer.createBot({
        host: process.env.IP_ADDR, 
        username: process.env.MINECRAFT_USERNAME_ALT,       
        auth: 'microsoft'             
    });

    const { mineflayer: mineflayerViewer } = require('prismarine-viewer')
    minecraft.once('spawn', () => {
        mineflayerViewer(minecraft, { port: 3007, firstPerson: true }) 
    });

.env

MINECRAFT_USERNAME_ALT = Amyloveswords

console


   Error
    at call (/media/hecker/SanDisk1/ultimate-hecker/Program Files & Accessories/Discord/Discord Applications/Cybernetic    Applications/Cybernetic-Beta/node_modules/yggdrasil/src/utils.js:35:40)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async join (/media/hecker/SanDisk1/ultimate-hecker/Program Files & Accessories/Discord/Discord Applications/Cybernetic Applications/Cybernetic-Beta/node_modules/yggdrasil/src/Server.js:20:12)

Expected behavior

I expected myself to just be able to joint he Minecraft Server and view it from prismarine-viewer

Additional context

I don't know if it is because I am running this on Linux, but I am fairly sure this will not cause an issue. I am fairly sure if I were to create a separate project this would work, but I wanted to communicate with mineflayer with discord.js.

amoraschi commented 2 years ago

Did you try using the email instead of the username?

ultimatehecker commented 2 years ago

Yes I did, didn't work

ultimatehecker commented 2 years ago

For some reason it works with my main Minecraft account, not my alt account, which I find weird

ultimatehecker commented 2 years ago

Fixed issue, mutliplayer for some reason was disabled