player_enter.mcfunction 566 B

12345678910111213141516171819202122
  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. tag @s remove diamond_got
  14. scoreboard players reset @s diamond
  15. scoreboard players set @s[team=playing,tag=!rejoining] diamond 0
  16. # 调整模式
  17. gamemode spectator @s[team=!debugging]
  18. gamemode survival @s[team=playing,tag=!rejoining]