tick2.mcfunction 1.5 KB

123456789101112131415161718192021222324252627282930313233
  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] bossbar_color 2
  20. scoreboard players set $bossbar_type mem 1
  21. function lib:bossbar/show
  22. bossbar set mini:yellow name "炸弹稳定度"
  23. bossbar set mini:red name {"text":"< ! > 你正持有炸弹 < ! >","color":"red"}
  24. # 粒子
  25. execute as @a[tag=pm_holding] at @s run particle minecraft:crit ~ ~1 ~ 0.2 0.5 0.2 0.5 10 normal @a[distance=0.01..]
  26. execute as @a[tag=pm_holding] at @s run particle minecraft:lava ~ ~1 ~ 0.1 0.1 0.1 0.5 1 force @a