tick20.mcfunction 1.6 KB

12345678910111213141516171819202122232425
  1. # 100s:教学
  2. execute if score $countdown mem matches 100 run tellraw @a[team=playing,scores={green_total=..10}] [{"text":"\n>> ","color":"light_purple","bold": true},{"text":"提示:留意隐蔽的角落与奇怪的地方,指不定里面就藏着宝藏……","bold":false},"\n"]
  3. # 地狱门音效
  4. scoreboard players set $random_max mem 3
  5. scoreboard players set $random_min mem 1
  6. function lib:random
  7. execute if score $random mem matches 2 run playsound block.portal.ambient ambient @a 1014.5 22 1057.5
  8. # 显示倒计时
  9. execute if score $countdown mem matches ..10 run title @a times 3 14 2
  10. execute if score $countdown mem matches ..10 run title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
  11. execute if score $countdown mem matches ..10 run title @a title [""]
  12. execute if score $countdown mem matches ..10 as @a at @s run function lib:sounds/hit2
  13. # 0s:游戏结束
  14. execute if score $countdown mem matches 0 run function mini:main/game_end
  15. # 如果当前宝藏不足 14 个,补充宝藏到 20 个
  16. scoreboard players set #item_count mem 20
  17. 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
  18. 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"}]
  19. execute if score #item_count mem matches 6.. run playsound block.amethyst_block.hit player @a 0 1000000 0 1000000 1
  20. execute if score #item_count mem matches 6.. run function mini:parkour/game/generate_loop