const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
username: 'aO_Oa',
host: 'mc4.weeaxe.cn',
version: '1.18'
})
const musicScore = '+1-10+1-10+5-10+5-10+6-10+6-10+5-10'
let note = 0
let wait = 20
bot.on('physicTick', () => {
if (wait != 0) { wait--; return }
if (note == musicScore.length - 1) { return }
while (musicScore[note] != '-') {
if (musicScore[note] == '+') { note++; continue }
bot.tabComplete('/// ' + musicScore[note])
note++
}
wait = ''
while (musicScore[note] != '+') {
if (musicScore[note] == '-') { note++; continue }
wait = wait + musicScore[note]
note++
}
wait = Number(wait)
wait--
})