player_enter.mcfunction 1011 B

1234567891011121314151617181920212223242526272829303132
  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. # 清理 Tag
  12. tag @s remove pm_holding
  13. tag @s remove pm_damage_dealt
  14. tag @s remove pm_damage_taken
  15. # 传送玩家
  16. spreadplayers 1023 3021 5 5 false @s[tag=!watcher,tag=!rejoining,tag=!debug]
  17. execute if entity @s[tag=!watcher,tag=!rejoining] run schedule function mini:hotpm/player_enter2 1t replace
  18. # 调整模式
  19. gamemode spectator @s[tag=!debug]
  20. gamemode adventure @s[tag=!watcher,tag=!rejoining,tag=!debug]
  21. # 设置玩家生命数量
  22. scoreboard players set @s[tag=!watcher,tag=!rejoining] mini_heart 2
  23. scoreboard players reset @s[tag=!watcher,tag=rejoining] mini_heart
  24. function mini:main/player_max_health
  25. # 重新加入处理
  26. execute if entity @s[tag=rejoining] run function mini:main/player_failed