const bot = mineflayer.createBot({
host: 'mc.hypixel.net', // minecraft server ip
username: 'censored', // minecraft username
password: 'censored' // minecraft password, comment out if you want to log into online-mode=false servers
// port: 25565, // only set if you need a port that isn't 25565
// version: 1.8.9, // only set if you need a specific version or snapshot (ie: "1.8.9" or "1.16.5"), otherwise it's set automatically
// auth: 'microsoft' // only set if you need microsoft auth, then set this to 'microsoft'
})
// Log errors and kick reasons:
bot.on('kicked', console.log)
bot.on('error', console.log)
const { mineflayer: mineflayerViewer } = require('prismarine-viewer')
bot.once('spawn', () => {
mineflayerViewer(bot, { port: 3007, firstPerson: true }) // port is the minecraft server port, if first person is false, you get a bird's-eye view
})
Issue Message: Error: Migrated
Chunk size is 27 but only 2 was read ; partial packet : {"name":170}; buffer :aa01187b226578747261223a5b22225d2c2274657874223a22227d
My Code
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({ host: 'mc.hypixel.net', // minecraft server ip username: 'censored', // minecraft username password: 'censored' // minecraft password, comment out if you want to log into online-mode=false servers // port: 25565, // only set if you need a port that isn't 25565 // version: 1.8.9, // only set if you need a specific version or snapshot (ie: "1.8.9" or "1.16.5"), otherwise it's set automatically // auth: 'microsoft' // only set if you need microsoft auth, then set this to 'microsoft' })
bot.on('chat', (username, message) => { if (username === bot.username) return bot.chat(message) })
// Log errors and kick reasons: bot.on('kicked', console.log) bot.on('error', console.log)
const { mineflayer: mineflayerViewer } = require('prismarine-viewer') bot.once('spawn', () => { mineflayerViewer(bot, { port: 3007, firstPerson: true }) // port is the minecraft server port, if first person is false, you get a bird's-eye view })
Issue Message: Error: Migrated Chunk size is 27 but only 2 was read ; partial packet : {"name":170}; buffer :aa01187b226578747261223a5b22225d2c2274657874223a22227d