tick5.mcfunction 1.3 KB

12345678910111213141516
  1. # 让无状态玩家变为准备状态
  2. execute as @a[tag=!lobby_ready,tag=!lobby_watch] run function item:lobby_state/join_watch
  3. # 给予进度
  4. execute as @a at @s if entity @s[x=-1,y=22,z=-29,dx=5,dy=3,dz=3] run advancement grant @s only ltw:parkour/explore1
  5. execute as @a at @s if entity @s[x=6,y=48,z=-32,dx=4,dy=3,dz=9] run advancement grant @s only ltw:parkour/explore2
  6. execute as @a at @s if entity @s[x=0,y=28,z=-46,distance=..4] run advancement grant @s only ltw:parkour/explore3
  7. # 隐藏/显示老板的名片
  8. execute as @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] at @s if entity @a[distance=..5] run data modify entity @s CustomNameVisible set value true
  9. execute as @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] at @s unless entity @a[distance=..5] run data modify entity @s CustomNameVisible set value false
  10. # 显示信息
  11. execute store result score $count mem if entity @a[tag=lobby_ready]
  12. execute if score $countdown mem matches 1.. run title @a actionbar [{"text":"","color":"green"},{"score":{"name":"$count","objective":"mem"}}," 人已准备 | ","将在 ",{"score":{"name":"#time","objective":"mem"}}," 秒后开始游戏"]
  13. execute if score $countdown mem matches 0 run title @a actionbar [{"text":"","color":"yellow"},{"score":{"name":"$count","objective":"mem"}}," 人已准备"]