From f2d8ad947d97c8e8c5f3ea12326fb68c66392ef6 Mon Sep 17 00:00:00 2001 From: imazicristina-sketch Date: Fri, 6 Nov 2026 00:07:48 +0545 Subject: [PATCH] Update index.js --- index.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index cb4f1ca628..43e78f941a 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,12 @@ -if (typeof process !== 'undefined' && !process.browser && process.platform !== 'browser' && parseInt(process.versions.node.split('.')[0]) < 18) { - console.error('Your node version is currently', process.versions.node) - console.error('Please update it to a version >= 22.x.x from https://nodejs.org/') - process.exit(1) -} +const mineflayer = require('mineflayer') -module.exports = require('./lib/loader.js') +const bot = mineflayer.createBot({ + host: process.env.MC_SERVER_HOST, + port: Number(process.env.MC_SERVER_PORT || 25565), + username: 'FrostBot', + auth: 'offline' +}) + +bot.on('login', () => console.log('Bot joined server!')) +bot.on('error', console.log) +bot.on('end', () => console.log('Bot disconnected'))