player_enter.mcfunction 888 B

12345678910111213141516171819202122232425262728293031
  1. # 单个玩家开始小游戏时执行
  2. function lib:sounds/music/mini_slow
  3. title @s clear
  4. title @s actionbar ""
  5. # 状态效果
  6. effect clear @s
  7. effect give @s saturation 1000000 0 true
  8. effect give @s instant_health 10 0 true
  9. gamerule naturalRegeneration false
  10. # 设置玩家生命
  11. attribute @s generic.max_health base set 20
  12. # 计分板重置
  13. scoreboard players reset @s kill_phantom
  14. scoreboard players reset @s kill_phantom2
  15. scoreboard players set @s[team=playing,tag=!rejoining] kill_phantom 0
  16. scoreboard players set @s[team=playing,tag=!rejoining] kill_phantom2 0
  17. scoreboard players reset @s use_trident
  18. scoreboard players reset @s countdown
  19. # 传送玩家
  20. tp @s[team=playing] 1030.5 24.5 6031.5
  21. # 调整模式
  22. gamemode spectator @s[team=!debugging]
  23. gamemode adventure @s[team=playing,tag=!rejoining]
  24. # 重新加入处理
  25. execute if entity @s[tag=rejoining] run gamemode spectator