-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
- 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?
- Verified that the Microsoft account credentials are correct.
- Confirmed that the server supports Microsoft account authentication.
- 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?