player_enter.mcfunction 938 B

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