Skip to content

Fix protocol version handling#344

Open
PrinceDale99 wants to merge 8 commits into
Sloboscc:mainfrom
PrinceDale99:main
Open

Fix protocol version handling#344
PrinceDale99 wants to merge 8 commits into
Sloboscc:mainfrom
PrinceDale99:main

Conversation

@PrinceDale99

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings July 8, 2026 07:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve Minecraft protocol/version handling for the bot by introducing explicit server version resolution (via settings or a status ping) before creating the Mineflayer bot instance.

Changes:

  • Updates default settings.json server/account values and adjusts chat message timing/content.
  • Adds minecraft-protocol ping-based version detection and wires the resolved version into mineflayer.createBot.
  • Adds logging and a failure path when version detection cannot be determined.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
settings.json Updates sample configuration values and chat message settings.
index.js Adds ping-based Minecraft version resolution and uses it when creating the bot.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread settings.json Outdated
Comment on lines 9 to 11
"ip": "your-server-address.com",
"port": 00000,
"version": "",
Comment thread settings.json Outdated
Comment on lines +34 to +36
"I'm a regular Minecraft Player",
"Subscribe to Slobos!",
"I like to play Minecraft!"
"Hello, evrybody!"
Comment thread index.js
Comment on lines 3 to 6
const { addLog, getLogs } = require("./logger");
const mineflayer = require("mineflayer");
const mcProtocol = require("minecraft-protocol");
const { Movements, pathfinder, goals } = require("mineflayer-pathfinder");
Comment thread index.js
Comment on lines +1244 to +1251
const botVersion = await resolveBotVersion();
if (!botVersion) {
addLog(
'[Bot] Unable to determine Minecraft version. Set "server.version" in settings.json to your exact server version.',
);
scheduleReconnect();
return;
}
Comment thread index.js
Comment on lines +1215 to +1217
} catch (err) {
addLog(`[Bot] Version ping failed: ${err.message}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants