tick5.mcfunction 1.2 KB

1234567891011121314151617181920
  1. # 挖出规则
  2. execute as @a[tag=mini_running] if score @s rgb_obtain_rule matches 1.. at @s run function mini:rgb/game/give_random_rule
  3. # 准备参数
  4. execute as @a[tag=mini_running] run scoreboard players operation @s rgb_take_damage -= @s rgb_health
  5. execute as @a run tellraw @s {"score":{"name": "@s","objective": "rgb_take_damage"}}
  6. # 对每一个玩家进行条件检定和事件执行
  7. execute as @a[tag=mini_running] at @s run function mini:rgb/game/player_tick
  8. # 清理计分板
  9. scoreboard players set @a[tag=mini_running] rgb_obtain_rule 0
  10. scoreboard players set @a[tag=mini_running] rgb_place_rule 0
  11. scoreboard players set @a[tag=mini_running] rgb_destroy_rule 0
  12. scoreboard players set @a[tag=mini_running] rgb_shift 0
  13. scoreboard players set @a[tag=mini_running] rgb_dig_ice 0
  14. execute as @a[tag=mini_running] run scoreboard players operation @s rgb_take_damage = @s rgb_health
  15. # 展示RGB计分
  16. execute as @a[tag=mini_running] run title @s actionbar [{"text":"R=","color": "red","bold": true},{"score":{"name": "@s","objective": "rgb_R"},"color": "red"}," ",{"text":"G=","color": "green"},{"score":{"name": "@s","objective": "rgb_G"},"color": "green"}," ",{"text":"B=","color": "blue"},{"score":{"name": "@s","objective": "rgb_B"},"color": "blue"}]