Files
jujutsu_craft_datapack
Code
21 342
jujutsu_craft_datapack/data/jjk/function/bossbar/update.mcfunction
# Update bossbar value and name for this player's slot
# Name format: "✨ Chú Lực: value/max"
execute if score @s ce_slot matches 1 run execute store result bossbar set jjk:ce_1 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 1 run bossbar set jjk:ce_1 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 2 run execute store result bossbar set jjk:ce_2 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 2 run bossbar set jjk:ce_2 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 3 run execute store result bossbar set jjk:ce_3 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 3 run bossbar set jjk:ce_3 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 4 run execute store result bossbar set jjk:ce_4 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 4 run bossbar set jjk:ce_4 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 5 run execute store result bossbar set jjk:ce_5 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 5 run bossbar set jjk:ce_5 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 6 run execute store result bossbar set jjk:ce_6 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 6 run bossbar set jjk:ce_6 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 7 run execute store result bossbar set jjk:ce_7 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 7 run bossbar set jjk:ce_7 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 8 run execute store result bossbar set jjk:ce_8 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 8 run bossbar set jjk:ce_8 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 9 run execute store result bossbar set jjk:ce_9 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 9 run bossbar set jjk:ce_9 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 10 run execute store result bossbar set jjk:ce_10 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 10 run bossbar set jjk:ce_10 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 11 run execute store result bossbar set jjk:ce_11 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 11 run bossbar set jjk:ce_11 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 12 run execute store result bossbar set jjk:ce_12 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 12 run bossbar set jjk:ce_12 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 13 run execute store result bossbar set jjk:ce_13 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 13 run bossbar set jjk:ce_13 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 14 run execute store result bossbar set jjk:ce_14 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 14 run bossbar set jjk:ce_14 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 15 run execute store result bossbar set jjk:ce_15 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 15 run bossbar set jjk:ce_15 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 16 run execute store result bossbar set jjk:ce_16 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 16 run bossbar set jjk:ce_16 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 17 run execute store result bossbar set jjk:ce_17 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 17 run bossbar set jjk:ce_17 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 18 run execute store result bossbar set jjk:ce_18 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 18 run bossbar set jjk:ce_18 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 19 run execute store result bossbar set jjk:ce_19 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 19 run bossbar set jjk:ce_19 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]
execute if score @s ce_slot matches 20 run execute store result bossbar set jjk:ce_20 value int run scoreboard players get @s ce_value
execute if score @s ce_slot matches 20 run bossbar set jjk:ce_20 name [{"text":"✨ Chú Lực: ","color":"light_purple"},{"score":{"name":"@s","objective":"ce_value"},"color":"aqua"},{"text":" / ","color":"gray"},{"score":{"name":"@s","objective":"ce_max"},"color":"aqua"}]