Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bot get kicked unverifed username #3591

Open
1 task
ccmsh opened this issue Feb 22, 2025 · 0 comments
Open
1 task

bot get kicked unverifed username #3591

ccmsh opened this issue Feb 22, 2025 · 0 comments
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@ccmsh
Copy link

ccmsh commented Feb 22, 2025

  • The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: 4.0.0
  • server: paper 1.20.4
  • node: 18.0.0

Detailed description of a problem

The bot shows Bot is ready! undefined when using Microsoft authentication, and after connecting to the server, it kicks with the error Kicked {"translate":"multiplayer.disconnect.unverified_username"}. It seems there is an issue with Microsoft account authentication.

I am trying to use mineflayer to connect a bot to a Minecraft server. The bot is configured to use Microsoft authentication, with the username and port set through environment variables.

What did you try yet?

  1. Verified that the Microsoft account credentials are correct.
  2. Confirmed that the server supports Microsoft account authentication.
  3. Tried adjusting the server's offline mode setting, but the issue persists.

Your current code

require("dotenv").config();
const { mineflayer: mineflayerViewer } = require("prismarine-viewer");
const mineflayer = require("mineflayer");
const { GoogleGenerativeAI } = require("@google/generative-ai");
const genAI = new GoogleGenerativeAI(process.env.GeminiToken);
async function say(_prompt) {
  const model = genAI.getGenerativeModel({ model: "gemini-pro" });
  const prompt = _prompt;
  const result = await model.generateContent({ prompt });
  const response = result.response;
  const text = response.text();
  return text;
}

const bot = mineflayer.createBot({
    host: process.env.MC_HOST || "###.###.####",       
    port: parseInt(process.env.MC_PORT) || 25565,   
    auth: "microsoft",
    username: process.env.MC_USERNAME || "###################", 
    version: process.env.MC_VERSION || "1.20.4",    
});

let target = null;
console.log(`Bot is ready! ${bot.username}`);
...

Expected behavior

The bot should log in successfully with the Microsoft account and display Bot is ready! <username>.
After connecting to the server, the bot should function without errors.

Additional context

It seems there is an issue with Microsoft account authentication, but I can't find a solution. Is there something I missed in the mineflayer configuration?

@ccmsh ccmsh added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests

1 participant