PrismarineJS / mineflayer

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

Unsupported brand channel name at getBrandCustomChannelName when connecting to server #2543

Closed VaibhavVerma21 closed 2 years ago

VaibhavVerma21 commented 2 years ago

This is my code const bot = mineflayer.createBot({ host: process.env['ip'], username: process.env['email'], password: process.env['password'], auth: 'microsoft', }) and it is just not able to login to minecraft. why? If you need additional info comment down.

amoraschi commented 2 years ago

What's your error, if there's no error, try adding an error listener

VaibhavVerma21 commented 2 years ago

What's your error, if there's no error, try adding an error listener

` Error: Unsupported brand channel name at getBrandCustomChannelName (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:22:11) at inject (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:54:24) at /home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:41:7 at Array.forEach () at injectPlugins (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:40:16) at EventEmitter.onInjectAllowed (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:12:5) at Object.onceWrapper (node:events:639:28) at EventEmitter.emit (node:events:520:28) at Client.next (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/loader.js:124:9) at Object.onceWrapper (node:events:639:28) Error: Unsupported brand channel name at getBrandCustomChannelName (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:22:11) at inject (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:54:24) at /home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:41:7 at Array.forEach () at injectPlugins (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:40:16) at EventEmitter.onInjectAllowed (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:12:5) at Object.onceWrapper (node:events:639:28) at EventEmitter.emit (node:events:520:28) at Client.next (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/loader.js:124:9) at Object.onceWrapper (node:events:639:28) Sign in failed, try removing the password field

/home/runner/Minecraft-bot/node_modules/@xboxreplay/errors/dist/index.js:25 unauthorized: (message = 'Unauthorized', reason = 'UNAUTHORIZED') => new XboxReplayError(message, { ^

XboxReplayError: Invalid credentials. at Object.unauthorized (/home/runner/Minecraft-bot/node_modules/@xboxreplay/errors/dist/index.js:25:74) at /home/runner/Minecraft-bot/node_modules/@xboxreplay/xboxlive-auth/dist/core/live/index.js:71:32 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async XboxTokenManager.doReplayAuth (/home/runner/Minecraft-bot/node_modules/prismarine-auth/src/TokenManagers/XboxTokenManager.js:133:31) at async MicrosoftAuthFlow.getXboxToken (/home/runner/Minecraft-bot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:117:20) at async retry.xbl.forceRefresh (/home/runner/Minecraft-bot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:157:22) at async retry (/home/runner/Minecraft-bot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:24:14) at async MicrosoftAuthFlow.getMinecraftJavaToken (/home/runner/Minecraft-bot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:156:7) at async Object.authenticate (/home/runner/Minecraft-bot/node_modules/minecraft-protocol/src/client/microsoftAuth.js:17:44) { XboxReplay: true, details: { statusCode: 401, reason: 'UNAUTHORIZED' } } ` I hope i am not revealing something bad from this for my account security

u9g commented 2 years ago

remove the password field from your createbot and try again

VaibhavVerma21 commented 2 years ago

remove the password field from your createbot and try again

After commenting the password line here is the error, and take this in mind it got spammed to me with no interval

[msa] First time signing in. Please authenticate now: To sign in, use a web browser to open the page https://www.microsoft.com/link and enter the code 43BB7ZUJ to authenticate. Error: Unsupported brand channel name at getBrandCustomChannelName (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:22:11) at inject (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:54:24) at /home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:41:7 at Array.forEach (<anonymous>) at injectPlugins (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:40:16) at EventEmitter.onInjectAllowed (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:12:5) at Object.onceWrapper (node:events:639:28) at EventEmitter.emit (node:events:520:28) at Client.next (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/loader.js:124:9) at Object.onceWrapper (node:events:639:28) Error: Unsupported brand channel name at getBrandCustomChannelName (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:22:11) at inject (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:54:24) at /home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:41:7 at Array.forEach (<anonymous>) at injectPlugins (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:40:16) at EventEmitter.onInjectAllowed (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:12:5) at Object.onceWrapper (node:events:639:28) at EventEmitter.emit (node:events:520:28) at Client.next (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/loader.js:124:9) at Object.onceWrapper (node:events:639:28)

u9g commented 2 years ago

Yes, so do it once.

VaibhavVerma21 commented 2 years ago

Yes, so do it once.

Nothing happens. When I restart it comes again

VaibhavVerma21 commented 2 years ago

Yes, so do it once.

Ok nvm, this time it just signed in successfuly and program stopped. and when i restart it doenst ask for sign in again but program doesnt run either

Error: Unsupported brand channel name at getBrandCustomChannelName (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:22:11) at inject (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:54:24) at /home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:41:7 at Array.forEach (<anonymous>) at injectPlugins (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:40:16) at EventEmitter.onInjectAllowed (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:12:5) at Object.onceWrapper (node:events:639:28) at EventEmitter.emit (node:events:520:28) at Client.next (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/loader.js:124:9) at Object.onceWrapper (node:events:639:28) Error: Unsupported brand channel name at getBrandCustomChannelName (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:22:11) at inject (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugins/game.js:54:24) at /home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:41:7 at Array.forEach (<anonymous>) at injectPlugins (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:40:16) at EventEmitter.onInjectAllowed (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/plugin_loader.js:12:5) at Object.onceWrapper (node:events:639:28) at EventEmitter.emit (node:events:520:28) at Client.next (/home/runner/Minecraft-bot/node_modules/mineflayer/lib/loader.js:124:9) at Object.onceWrapper (node:events:639:28)

u9g commented 2 years ago

what mc version is the server? & what mineflayer version?

VaibhavVerma21 commented 2 years ago

what mc version is the server? & what mineflayer version?

The server is a fabric 1.18.2 and how can I check the mineflayer version? It's on repl btw

VaibhavVerma21 commented 2 years ago

what mc version is the server? & what mineflayer version?

Not sure but i think it is 3.18 You got any commands to check what is the version?

SzczurekYT commented 2 years ago

I also had similar issues. I was using wrong password. Also make sure you are using email as username, not you minecraft nickname.

VaibhavVerma21 commented 2 years ago

I also had similar issues. I was using wrong password. Also make sure you are using email as username, not you minecraft nickname.

Have made sure

u9g commented 2 years ago

So what's the problem now?

xViada commented 2 years ago

I have exactly the same problem as you, I can't find a solution

nebula161 commented 2 years ago

Same issue, but my config didn't have the password in the first place. it did use microsoft auth as well though

extremeheat commented 2 years ago

The problem here has nothing to do with ms auth. For this error I suggest to try connecting to a different Minecraft server

If you have actual authentication problems I suggest changing username and removing the password field and if that does not work,

Log out of the launcher, log in again with your account and repeat the step above with your code.

If it still doesn’t work you can ask a specific question with detailed information with information about any errors on the discord or in a discussion

nebula161 commented 2 years ago

The problem here has nothing to do with ms auth. For this error I suggest to try connecting to a different Minecraft server

Wish I could, this doesn't really seem to be an option. I get the same error when connecting to my own computer

If you have actual authentication problems I suggest changing username and removing the password field and if that does not work,

I've done this

Log out of the launcher, log in again with your account and repeat the step above with your code.

This part too, I'm pretty sure

If it still doesn’t work you can ask a specific question with detailed information with information about any errors on the discord or in a discussion

Well, this is my error:

Error: Unsupported brand channel name
    at getBrandCustomChannelName (C:\Users\user\node_modules\mineflayer\lib\plugins\game.js:22:11)
    at inject (C:\Users\user\node_modules\mineflayer\lib\plugins\game.js:54:24)
    at C:\Users\user\node_modules\mineflayer\lib\plugin_loader.js:41:7
    at Array.forEach (<anonymous>)
    at injectPlugins (C:\Users\user\node_modules\mineflayer\lib\plugin_loader.js:40:16)
    at EventEmitter.onInjectAllowed (C:\Users\user\node_modules\mineflayer\lib\plugin_loader.js:12:5)
    at Object.onceWrapper (node:events:641:28)
    at EventEmitter.emit (node:events:527:28)
    at next (C:\Users\user\node_modules\mineflayer\lib\loader.js:124:9)
    at Object.createBot (C:\Users\user\node_modules\mineflayer\lib\loader.js:105:34)

I've already authed the account for microsoft. This is my createBot call

 var botConfig = {
        viewDistance: 2,
        username: "NEBULA",  
        keepAlive: true,
        host: "paper.velocityserver", not the actual ip
        version: "1.18.2",       
        physicsEnabled: true, 
        auth: "microsoft"
    }
var bot = mineflayer.createBot(botConfig)
SzczurekYT commented 2 years ago

This is my createBot call

 var botConfig = {
        viewDistance: 2,
        username: "NEBULA",  
        keepAlive: true,
        host: "paper.velocityserver", not the actual ip
        version: "1.18.2",       
        physicsEnabled: true, 
        auth: "microsoft"
    }
var bot = mineflayer.createBot(botConfig)

Try to use email instead of nickname.

nickelpro commented 2 years ago

It's got nothing to do with authentication.

The problem is that bot.supportFeatures isn't returning the correct information for the brand channel. The most likely reason for that is needing to update minecraft-data. Minecraft data supports the correct channel prefixing information for all versions (https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/common/features.json#L48-L56) so the only way to get this error is to be using a minecraft-data version that is older than the version of minecraft you're targeting (https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/game.js#L16-L23).

nickelpro commented 2 years ago

Recommend closing @u9g

u9g commented 2 years ago

Just uninstall mineflayer and reinstall it. then ensure you are on the latest version (currently 4.3.0), then try your code again and it will run fine.