player_enter.mcfunction 876 B

123456789101112131415161718192021222324252627282930
  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 3
  22. function mini:main/player_max_health
  23. # 重新加入处理
  24. execute if entity @s[tag=rejoining] run function mini:hotpm/player_lose_heart