use bot.version

This commit is contained in:
ChomeNS 2022-10-19 07:59:58 +07:00
parent 6e5af6a60b
commit be57d2caf2
3 changed files with 8 additions and 6 deletions

View file

@ -1,6 +1,4 @@
/* eslint-disable max-len */
// eslint-disable-next-line no-unused-vars
const mcData = require('minecraft-data')('1.18.2');
module.exports = {
name: 'entity',
alias: [],
@ -8,6 +6,9 @@ module.exports = {
usage: '[specific] <player>',
trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args) {
// eslint-disable-next-line no-unused-vars
const mcData = require('minecraft-data')(bot.version);
throw new Error('Execute Bypass is patched so this command will be broken for now!');
// if (!args[0]) return;
// const entity = mcData.entitiesByName[args[0]];

View file

@ -8,8 +8,6 @@ const mc = require('minecraft-protocol');
const config = require('./config');
const crypto = require('crypto');
const colorConvert = require('color-convert');
const chatMessage = require('prismarine-chat')('1.18.2');
const mcData = require('minecraft-data')('1.18.2');
const {containsIllegalCharacters} = require('./util/containsIllegalCharacters');
const generateEaglerUsername = require('./util/generateEaglerUsername');
const {EventEmitter} = require('events');
@ -222,12 +220,15 @@ 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) {
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;

View file

@ -2,9 +2,9 @@
/* eslint-disable require-jsdoc */
// eslint-disable-next-line no-undef
// const parse = require('../util/text_parser');
const ChatMessage = require('prismarine-chat')('1.18.2');
function inject(bot) {
const ChatMessage = require('prismarine-chat')(bot.version);
bot._client.on('chat', async (packet) => {
try {
// const message = parse(packet.message);