Open
Description
- The [FAQ](https://github.com/PrismarineJS/mineflayer/blob/master/docs/FAQ.md) doesn't contain a resolution to my issue
Versions
- mineflayer: #.#.#
- server: Paper 1.21.5 (behind BungeeCord proxy)
- node: v23.11.0
Detailed description of a problem
I’m building a Mineflayer bot that should switch between backend servers via a BungeeCord proxy by issuing a chat-command. When I run /server hub
, the bot is correctly sent through the proxy but then immediately disconnects with a timeout (e.g. Error: Timed out
). Manually typing the same command as a player works fine—only the bot is getting dropped.
What did you try yet?
- Verified that the proxy and backend servers work for real players.
- Tried issuing the switch command both in
bot.once('spawn')
andbot.once('login')
. - Disabled physics and other plugins (no effect).
- Attempted using the
version
andcheckTimeoutInterval
options when creating the bot.
Your current code
const mineflayer = require('mineflayer');
const bot = mineflayer.createBot({
host: 'proxy.example.com',
port: 25565,
username: 'MyBot',
version: '1.21.5',
checkTimeoutInterval: 60 * 1000
});
bot.once('spawn', () => {
// Send through BungeeCord to the “hub” server
bot.chat('/server hub');
});
bot.on('end', (reason) => {
console.log('Disconnected:', reason);
});
bot.on('error', (err) => {
console.error('Bot error:', err);
});
Expected behavior
After sending /server hub
, the bot should reconnect seamlessly to the hub backend and stay online, just like a normal player, instead of immediately timing out.
Additional context
- BungeeCord is set up with multiple backend instances on different ports.
- No special firewall or IP-whitelisting rules on the proxy.
- The disconnect message is always a timeout rather than a KICK packet.
- Happy to provide logs or a packet capture if it helps!