tick20.mcfunction 1.3 KB

123456789101112131415161718192021
  1. # 地狱门音效
  2. scoreboard players set $random_max mem 3
  3. scoreboard players set $random_min mem 1
  4. function lib:random
  5. execute if score $random mem matches 2 run playsound block.portal.ambient ambient @a 1014.5 22 1057.5
  6. # 显示倒计时
  7. execute if score $countdown mem matches ..10 run title @a times 3 14 2
  8. execute if score $countdown mem matches ..10 run title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
  9. execute if score $countdown mem matches ..10 run title @a title [""]
  10. execute if score $countdown mem matches ..10 as @a at @s run function lib:sounds/hit2
  11. # 0s:游戏结束
  12. execute if score $countdown mem matches 0 run function mini:main/game_end
  13. # 如果当前宝藏不足 14 个,补充宝藏到 20 个
  14. scoreboard players set #item_count mem 20
  15. execute as @e[tag=bonus_item,x=1000,y=0,z=1000,dx=100,dy=100,dz=100] run scoreboard players remove #item_count mem 1
  16. execute if score #item_count mem matches 6.. run tellraw @a ["",{"text": ">> ","color":"gold","bold":true},{"score": {"name": "#item_count","objective": "mem"},"color":"gold"},{"text": " 处新的宝藏已出现!","color":"gold"}]
  17. execute if score #item_count mem matches 6.. run playsound block.amethyst_block.hit player @a 0 1000000 0 1000000 1
  18. execute if score #item_count mem matches 6.. run function mini:parkour/game/generate_loop