mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2025-02-17 06:40:17 -05:00
core customname config
This commit is contained in:
parent
3322cb5cb0
commit
e4c7c59266
2 changed files with 16 additions and 2 deletions
10
config.js
10
config.js
|
@ -16,6 +16,16 @@ module.exports = {
|
||||||
'core': {
|
'core': {
|
||||||
'layers': 3,
|
'layers': 3,
|
||||||
'refillInterval': 1000 * 60,
|
'refillInterval': 1000 * 60,
|
||||||
|
'customName': [
|
||||||
|
{
|
||||||
|
text: 'ChomeNS Bot ',
|
||||||
|
color: 'yellow',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Core',
|
||||||
|
color: 'green',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
'self_care': {
|
'self_care': {
|
||||||
'prefix': true,
|
'prefix': true,
|
||||||
|
|
|
@ -16,7 +16,11 @@ function inject(bot, dcclient, config) {
|
||||||
},
|
},
|
||||||
run(command) {
|
run(command) {
|
||||||
try {
|
try {
|
||||||
if (config.useChat && command.startsWith('minecraft:tellraw @a ') && !command.includes('Console') && !command.includes('Discord')) {
|
if (config.useChat &&
|
||||||
|
command.startsWith('minecraft:tellraw @a ') &&
|
||||||
|
!command.includes('Console') &&
|
||||||
|
!command.includes('Discord')
|
||||||
|
) {
|
||||||
bot.chat(chatMessage.fromNotch(command.replace('minecraft:tellraw @a ', '')).toMotd().replaceAll('\xa7', '&'));
|
bot.chat(chatMessage.fromNotch(command.replace('minecraft:tellraw @a ', '')).toMotd().replaceAll('\xa7', '&'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +57,7 @@ function inject(bot, dcclient, config) {
|
||||||
},
|
},
|
||||||
async loopPlace() {
|
async loopPlace() {
|
||||||
try {
|
try {
|
||||||
const fillCommand = `/minecraft:fill ${core.start.x} ${core.start.y} ${core.start.z} ${core.end.x} ${core.end.y} ${core.end.z} command_block{CustomName:'{"text":"ChomeNS Bot Core","color":"yellow"}'}`;
|
const fillCommand = `/minecraft:fill ${core.start.x} ${core.start.y} ${core.start.z} ${core.end.x} ${core.end.y} ${core.end.z} command_block${config.core.customName ? `{CustomName:'${JSON.stringify(config.core.customName)}'}` : ''}`;
|
||||||
const location = {x: Math.floor(bot.position.x), y: Math.floor(bot.position.y) - 1, z: Math.floor(bot.position.z)};
|
const location = {x: Math.floor(bot.position.x), y: Math.floor(bot.position.y) - 1, z: Math.floor(bot.position.z)};
|
||||||
bot.write('set_creative_slot', {
|
bot.write('set_creative_slot', {
|
||||||
slot: 36,
|
slot: 36,
|
||||||
|
|
Loading…
Reference in a new issue