Files
mc_datapack/music_quiz/data/mq/function/quiz/select.mcfunction

15 lines
805 B
MCFunction

scoreboard players add init main 3
scoreboard players set timer main 0
execute if score index main >= max_index main run return run function mq:quiz/end with storage mq:main
scoreboard players add index main 1
execute store result storage mq:main command_block.index int 1 run scoreboard players get index main
# 보스바
bossbar set mq:process name [{"text":"진행도: ","color": "yellow","bold": true},{"score":{"name":"index","objective": "main"},"color": "yellow","bold": true},{"text":"/","color": "yellow","bold": true},{"score":{"name":"max_index","objective": "main"},"color": "yellow","bold": true}]
bossbar set mq:process players @a
execute store result bossbar mq:process value run scoreboard players get index main
function mq:quiz/macro/command_block with storage mq:main command_block