mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 01:25:33 -05:00
finally music actionbar fix
This commit is contained in:
parent
48d54532a5
commit
fbec2003be
1 changed files with 1 additions and 1 deletions
|
@ -45,12 +45,12 @@ function inject (bot) {
|
|||
if (!bot.music.queue.length) return
|
||||
bot.music.song = bot.music.queue[0]
|
||||
time = Date.now() - startTime
|
||||
bot.core.run('minecraft:title @a[tag=!nomusic] actionbar ' + JSON.stringify(toComponent()))
|
||||
while (bot.music.song.notes[noteIndex]?.time <= time) {
|
||||
const note = bot.music.song.notes[noteIndex]
|
||||
const floatingPitch = 2 ** ((note.pitch - 12) / 12.0)
|
||||
bot.core.run(`minecraft:execute as @a[tag=!nomusic] at @s run playsound ${soundNames[note.instrument]} record @s ~ ~ ~ ${note.volume} ${floatingPitch}`)
|
||||
noteIndex++
|
||||
bot.core.run('minecraft:title @a[tag=!nomusic] actionbar ' + JSON.stringify(toComponent()))
|
||||
if (noteIndex >= bot.music.song.notes.length) {
|
||||
if (bot.music.loop === 1) {
|
||||
resetTime()
|
||||
|
|
Loading…
Reference in a new issue