mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -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': {
|
||||
'layers': 3,
|
||||
'refillInterval': 1000 * 60,
|
||||
'customName': [
|
||||
{
|
||||
text: 'ChomeNS Bot ',
|
||||
color: 'yellow',
|
||||
},
|
||||
{
|
||||
text: 'Core',
|
||||
color: 'green',
|
||||
},
|
||||
],
|
||||
},
|
||||
'self_care': {
|
||||
'prefix': true,
|
||||
|
|
|
@ -16,7 +16,11 @@ function inject(bot, dcclient, config) {
|
|||
},
|
||||
run(command) {
|
||||
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', '&'));
|
||||
return;
|
||||
}
|
||||
|
@ -53,7 +57,7 @@ function inject(bot, dcclient, config) {
|
|||
},
|
||||
async loopPlace() {
|
||||
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)};
|
||||
bot.write('set_creative_slot', {
|
||||
slot: 36,
|
||||
|
|
Loading…
Reference in a new issue