player_enter.mcfunction 1.0 KB

1234567891011121314151617181920212223242526
  1. # 当玩家加入游戏时触发
  2. team join player @s
  3. advancement revoke @s only lib:damage_dealt
  4. advancement revoke @s only lib:damage_taken
  5. advancement revoke @s only item:container/place
  6. advancement revoke @s only item:special/consume_enchanted_apple
  7. advancement revoke @s only item:special/consume_golden_apple
  8. execute as @a at @s run function lib:sounds/hit
  9. # 存储UUID
  10. execute store result score @s UUID run data get entity @s UUID[0]
  11. # 如果是旁观者或局号不对头:开始旁观
  12. execute if entity @s[tag=watcher] run function ltw:main/player_enter_watcher
  13. execute if entity @s[tag=!watcher] unless score @s game_id = $ game_id run function ltw:main/player_enter_watcher
  14. # 如果不是旁观且局号正确:游戏中掉线
  15. execute if entity @s[tag=!watcher] if score @s game_id = $ game_id run function ltw:main/player_enter_rejoin
  16. # 更新 Bossbar
  17. bossbar set ltw:notice players @a
  18. function lib:bossbar/show
  19. # FIXME: 不再允许偷到 -1 分
  20. # FIXME: 旁观者在游戏开局的时候似乎会看到 2 然后 ding