mineflayer: 1.12.2 not supported and no error displayed
Server: spigot git-Spigot-93e20b3-b8f84f3 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT), no plugins Client: npm 5.4.2
Steps to reproduce:
- clone repository
- run any example. In my case I did
node jumper.js 192.168.0.220 25565 ChanChan
- bot connects for a couple of seconds and then simply disconnects. I get this behavior constantly
On server side:
[22:41:21] [Server thread/INFO]: ChanChan lost connection: Disconnected
[22:41:21] [Server thread/INFO]: ChanChan left the game
I tried to debug the minecraft protocol, nothing seems off, client code is not throwing any errors.
Same goes with vanilla server
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (8 by maintainers)
1.12.2 seems to mostly work (it is listed as supported on minecraft-data) The issue of disconnecting 20 seconds after joining seems to be because “Keep Alive” was changed in 1.12.2. (which is defaulted to 20 seconds)
It works with 25 or more seconds, so using mineflayer you can set the “checkTimeoutInterval” option.
var mineflayer = require('mineflayer');
var bot = mineflayer.createBot({
host: "localhost", // optional
port: 25565, // optional
username: "email@example.com", // email and password are required only for
password: "12345678", // online-mode=true servers
checkTimeoutInterval: (25 * 10000) // run KeepAlive every 25 seconds
});
The original 20 seconds can be found in “minecraft-protocol\src\client\keepalive.js:7”
const checkTimeoutInterval = options.checkTimeoutInterval || 20 * 1000;