player_enter.mcfunction 540 B

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