player_enter.mcfunction 639 B

123456789101112131415161718192021222324
  1. # 单个玩家开始小游戏时执行
  2. # TODO: 让 BGM 支持循环播放
  3. function lib:sounds/music/mini_slow
  4. title @s clear
  5. title @s actionbar ""
  6. # 触发复活
  7. say 1
  8. execute as @s[team=playing] run say 2
  9. execute as @s[team=playing,tag=!rejoining] run say 3
  10. function mini:diamond/player_death
  11. effect give @s slowness 0
  12. effect give @s blindness 0
  13. # 设置玩家生命
  14. attribute @s generic.max_health base set 20
  15. # 计分板重置
  16. scoreboard players reset @s diamond
  17. scoreboard players set @s[team=playing,tag=!rejoining] diamond 0
  18. # 调整模式
  19. gamemode spectator @s[team=!debugging]
  20. gamemode survival @s[team=playing,tag=!rejoining]