mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
fix?
This commit is contained in:
parent
f843316c60
commit
fb53177b39
1 changed files with 4 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue