2
0

tick2.mcfunction 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. # 随机时间
  2. scoreboard players set $random_min mem -4
  3. scoreboard players set $random_max mem 4
  4. function lib:random
  5. scoreboard players operation $countdown_fast mem += $random mem
  6. execute if score $countdown_fast mem matches ..0 run scoreboard players set $countdown_fast mem 0
  7. # 爆炸
  8. execute if score $countdown_fast mem matches 0 if entity @a[tag=pm_holding] run function mini:hotpm/player_lose_heart
  9. # 存活加分
  10. execute if score $countdown_fast mem matches 0 run scoreboard players add @a[tag=mini_running] surviveRound 1
  11. # 检测土豆
  12. function mini:hotpm/game/pm_check
  13. # 往手上塞 TNT
  14. execute as @a[tag=pm_holding] unless data entity @s Inventory[{Slot:8b,tag:{game_item:1b},Count:1b}] run function mini:hotpm/game/pm_show
  15. execute as @a[tag=!pm_holding] if data entity @s Inventory[{tag:{game_item:1b}}] run clear @s tnt{game_item:1b}
  16. # HUD
  17. scoreboard players set $bossbar_color mem 0
  18. scoreboard players set @a[tag=pm_holding] bossbar_color 1
  19. execute as @p[tag=pm_holding] at @s run scoreboard players set @a[tag=!pm_holding,distance=..14] bossbar_color 2
  20. execute as @p[tag=pm_holding] at @s run scoreboard players set @a[tag=!pm_holding,distance=14..] bossbar_color 3
  21. scoreboard players set $bossbar_type mem 1
  22. function lib:bossbar/show
  23. bossbar set mini:green name "炸弹稳定度"
  24. bossbar set mini:yellow name "炸弹稳定度"
  25. bossbar set mini:red name {"text":"炸弹稳定度","color":"red"}