diff --git a/index.js b/index.js index b8e4d52..10f693b 100644 --- a/index.js +++ b/index.js @@ -105,6 +105,9 @@ function botThings() { hideErrors: true, }; bot._client = mc.createClient(bot.options); + bot.uuid = bot._client.uuid; + bot.username = bot._client.username; + bot.version = bot._client.version; bot.queue = []; bot.write = (name, data) => bot._client.write(name, data); bot.end = (reason = 'end') => { @@ -220,15 +223,12 @@ function main() { // fs.appendFileSync('./logs.txt', `\r\Connecting to: ${bot.options.host}:${bot.options.port}...\r\n`); channel.send(`Connecting to: \`${bot.options.host}:${bot.options.port}\`...`); bot._client.on('login', async function(data) { + bot.entityId = data.entityId; const chatMessage = require('prismarine-chat')(bot.version); const mcData = require('minecraft-data')(bot.version); console.log(`Successfully logged in to: ${bot.options.host}:${bot.options.port}`); // fs.appendFileSync('./logs.txt', `\r\nSuccessfully logged in to: ${bot.options.host}:${bot.options.port}\r\n`); channel.send(`Successfully logged in to: \`${bot.options.host}:${bot.options.port}\``); - bot.uuid = bot._client.uuid; - bot.username = bot._client.username; - bot.entityId = data.entityId; - bot.version = bot._client.version; previusMessage = undefined; loginfinish = false; started = false;