Relative Content

Tag Archive for javascriptbotsminecraft

How do I connect my bot to an online server? [code from below]

const mf = require(‘mineflayer’) const pv = require(‘prismarine-viewer’) const bot = mf.createBot({ username: ‘Bot’, password: ‘pass’, host: ‘185.35.19.210’, port: 25565, }) bot.once(‘spawn’, () => { pv(bot, { port: 3000 }) bot.chat(‘/log password’) const path = [bot.entity.position.clone()] bot.on(‘move’, () => { if (path[path.length – 1].distanceTo(bot.entity.position) > 1) { path.push(bot.entity.position.clone()) bot.viewer.drawLine(‘path’, path) } }) }) I tried […]