player_enter.mcfunction 829 B

12345678910111213141516171819202122232425262728293031
  1. # 单个玩家开始小游戏时执行
  2. function lib:sounds/music/mini_middle
  3. title @s clear
  4. title @s actionbar ""
  5. # 状态效果
  6. effect clear @s
  7. effect give @s saturation 1000000 0 true
  8. gamerule naturalRegeneration true
  9. effect give @s night_vision 1000000 0 true
  10. effect give @s resistance 1000000 4 true
  11. # 设置玩家生命
  12. scoreboard players set @s[team=playing,tag=!rejoining] mini_heart 3
  13. function mini:main/player_max_health
  14. # 清理 Tag
  15. tag @s remove pm_holding
  16. tag @s remove pm_damage_dealt
  17. tag @s remove pm_damage_taken
  18. tag @s remove pm_explode_last
  19. # 传送玩家
  20. tp @s[team=playing,tag=!rejoining] 1018.0 8 3015.0
  21. # 调整模式
  22. gamemode spectator @s[team=!debugging]
  23. gamemode adventure @s[team=playing,tag=!rejoining]
  24. # 重新加入处理
  25. execute if entity @s[tag=rejoining] run function mini:main/player_failed