player_enter.mcfunction 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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. tp @s[tag=!watcher,tag=!rejoining,tag=!debug] 1023 25 3021
  17. # spreadplayers 1023 3021 5 5 false @s[tag=!watcher,tag=!rejoining,tag=!debug]
  18. # schedule function mini:hotpm/player_enter2 1t replace
  19. # execute as @a[tag=!watcher,tag=!rejoining,tag=!debug] at @s run tp @s ~ 25 ~
  20. # 调整模式
  21. gamemode spectator @s[tag=!debug]
  22. gamemode adventure @s[tag=!watcher,tag=!rejoining,tag=!debug]
  23. # 设置玩家生命数量
  24. scoreboard players set @s[tag=!watcher,tag=!rejoining] mini_heart 2
  25. scoreboard players reset @s[tag=!watcher,tag=rejoining] mini_heart
  26. function mini:main/player_max_health
  27. # 重新加入处理
  28. execute if entity @s[tag=rejoining] run function mini:main/player_failed