mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-12-17 19:02:22 -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 "
|
"/cbot "
|
||||||
],
|
],
|
||||||
"core": {
|
"core": {
|
||||||
|
"useChat": true,
|
||||||
"layers": 1
|
"layers": 1
|
||||||
},
|
},
|
||||||
"discord": {
|
"discord": {
|
||||||
|
|
2
index.js
2
index.js
|
@ -8,7 +8,7 @@ const mc = require('minecraft-protocol');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const colorConvert = require('color-convert');
|
const colorConvert = require('color-convert');
|
||||||
const chatMessage = require('prismarine-chat')('1.18.2');
|
const chatMessage = require('prismarine-chat')('1.18.2');
|
||||||
const generateEaglerUsername = require('./util/generateEaglerUsername')
|
const generateEaglerUsername = require('./util/generateEaglerUsername');
|
||||||
const {EventEmitter} = require('events');
|
const {EventEmitter} = require('events');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* eslint-disable max-len */
|
/* eslint-disable max-len */
|
||||||
/* eslint-disable require-jsdoc */
|
/* eslint-disable require-jsdoc */
|
||||||
const config = require('../config.json');
|
const config = require('../config.json');
|
||||||
|
const chatMessage = require('prismarine-chat')('1.18.2');
|
||||||
const Vec3 = require('vec3');
|
const Vec3 = require('vec3');
|
||||||
|
|
||||||
const relativePosition = new Vec3(0, 0, 0);
|
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;
|
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) {
|
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++;
|
relativePosition.x++;
|
||||||
|
|
||||||
if (relativePosition.x >= 16) {
|
if (relativePosition.x >= 16) {
|
||||||
|
|
|
@ -54,7 +54,7 @@ function inject(bot) {
|
||||||
gameMode = data.gameMode;
|
gameMode = data.gameMode;
|
||||||
});
|
});
|
||||||
|
|
||||||
const interval = setInterval(() => {
|
setInterval(() => {
|
||||||
if (!op) {
|
if (!op) {
|
||||||
bot.chat('/minecraft:op @s[type=player]');
|
bot.chat('/minecraft:op @s[type=player]');
|
||||||
return;
|
return;
|
||||||
|
@ -65,11 +65,7 @@ function inject(bot) {
|
||||||
if (gameMode !== 1) bot.chat('/minecraft:gamemode creative @s[type=player]');
|
if (gameMode !== 1) bot.chat('/minecraft:gamemode creative @s[type=player]');
|
||||||
if (!prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]');
|
if (!prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]');
|
||||||
if (muted) bot.chat('/essentials:mute ' + bot.uuid);
|
if (muted) bot.chat('/essentials:mute ' + bot.uuid);
|
||||||
}, 1000 * 5);
|
}, 1000);
|
||||||
|
|
||||||
bot.once('end', () => {
|
|
||||||
clearInterval(interval);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {inject};
|
module.exports = {inject};
|
||||||
|
|
Loading…
Reference in a new issue