diff --git a/bot.js b/bot.js index 21c2efd..a0a1043 100644 --- a/bot.js +++ b/bot.js @@ -27,7 +27,6 @@ const mineflayer = require('mineflayer') */ async function createBot (server, config, getBots, setNewBot, dcclient, rl) { const bot = new EventEmitter() - bot.setMaxListeners(Infinity) // is this bad code? bot.options = { username: !server.kaboom ? 'ChomeNS_Bot' @@ -42,6 +41,8 @@ async function createBot (server, config, getBots, setNewBot, dcclient, rl) { hideErrors: true } bot._client = mc.createClient(bot.options) + bot.setMaxListeners(Infinity) // is this bad code? + bot._client.setMaxListeners(Infinity) // this too bot.version = bot._client.version bot.write = (name, data) => bot._client.write(name, data) bot.end = (reason = 'end', event) => {