From fb53177b391951028cd6606e3b02c783103967fa Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Mon, 2 Jan 2023 13:13:47 +0700 Subject: [PATCH] fix? --- plugins/music.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/music.js b/plugins/music.js index 8a50fd5..9c442e9 100644 --- a/plugins/music.js +++ b/plugins/music.js @@ -41,6 +41,8 @@ function inject (bot) { resetTime() } + const bossbarName = 'chomens_bot:music' // maybe make this in the config? + const interval = setInterval(async () => { if (!bot.music.queue.length) return bot.music.song = bot.music.queue[0] @@ -48,8 +50,7 @@ function inject (bot) { // bot.core.run('minecraft:title @a[tag=!nomusic] actionbar ' + JSON.stringify(toComponent())) // is spamming commands in core as a self care a good idea? - // btw this is totallynotskidded™️ from my song bot except the bossbarName - const bossbarName = 'chomens_bot:music' // maybe make this in the config? + // btw this is totallynotskidded™️ from my song bot except the bossbarName (above) bot.core.run(`minecraft:bossbar add ${bossbarName} ""`) // is setting the name to "" as a placeholder a good idea? bot.core.run(`minecraft:bossbar set ${bossbarName} players @a[tag=!nomusic]`) bot.core.run(`minecraft:bossbar set ${bossbarName} name ${JSON.stringify(toComponent())}`) @@ -76,7 +77,6 @@ function inject (bot) { } bot.music.queue.shift() if (!bot.music.queue[0]) { - bot.core.run(`minecraft:bossbar remove ${bossbarName}`) bot.tellraw('@a', { text: 'Finished playing every song in the queue' }) bot.music.stop() return @@ -130,6 +130,7 @@ function inject (bot) { time = 0 startTime = Date.now() noteIndex = 0 + bot.core.run(`minecraft:bossbar remove ${bossbarName}`) // maybe not a good place to put it here but idk } function formatTime (time) {