mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-23 15:47:57 -05:00
many updates1!1
This commit is contained in:
parent
fc041865b5
commit
a3a878cd29
4 changed files with 10 additions and 7 deletions
|
@ -5,6 +5,7 @@
|
|||
"/cbot "
|
||||
],
|
||||
"core": {
|
||||
"useChat": true,
|
||||
"layers": 1
|
||||
},
|
||||
"discord": {
|
||||
|
|
2
index.js
2
index.js
|
@ -8,7 +8,7 @@ const mc = require('minecraft-protocol');
|
|||
const crypto = require('crypto');
|
||||
const colorConvert = require('color-convert');
|
||||
const chatMessage = require('prismarine-chat')('1.18.2');
|
||||
const generateEaglerUsername = require('./util/generateEaglerUsername')
|
||||
const generateEaglerUsername = require('./util/generateEaglerUsername');
|
||||
const {EventEmitter} = require('events');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* eslint-disable max-len */
|
||||
/* eslint-disable require-jsdoc */
|
||||
const config = require('../config.json');
|
||||
const chatMessage = require('prismarine-chat')('1.18.2');
|
||||
const Vec3 = require('vec3');
|
||||
|
||||
const relativePosition = new Vec3(0, 0, 0);
|
||||
|
@ -12,6 +13,11 @@ function inject(bot) {
|
|||
return position.x >= core.start.x && position.x <= core.end.x && position.y >= core.start.y && position.y <= core.end.y && position.z >= core.start.z && position.z <= core.end.z;
|
||||
},
|
||||
run(command) {
|
||||
if (config.core.useChat && command.startsWith('minecraft:tellraw @a ')) {
|
||||
bot.chat(chatMessage.fromNotch(command.replace('minecraft:tellraw @a ', '')).toMotd().replaceAll('§', '&'));
|
||||
return;
|
||||
}
|
||||
|
||||
relativePosition.x++;
|
||||
|
||||
if (relativePosition.x >= 16) {
|
||||
|
|
|
@ -54,7 +54,7 @@ function inject(bot) {
|
|||
gameMode = data.gameMode;
|
||||
});
|
||||
|
||||
const interval = setInterval(() => {
|
||||
setInterval(() => {
|
||||
if (!op) {
|
||||
bot.chat('/minecraft:op @s[type=player]');
|
||||
return;
|
||||
|
@ -65,11 +65,7 @@ function inject(bot) {
|
|||
if (gameMode !== 1) bot.chat('/minecraft:gamemode creative @s[type=player]');
|
||||
if (!prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]');
|
||||
if (muted) bot.chat('/essentials:mute ' + bot.uuid);
|
||||
}, 1000 * 5);
|
||||
|
||||
bot.once('end', () => {
|
||||
clearInterval(interval);
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
module.exports = {inject};
|
||||
|
|
Loading…
Reference in a new issue