2
0

player_enter.mcfunction 973 B

1234567891011121314151617181920212223242526272829303132333435
  1. # 单个玩家开始小游戏时执行
  2. function lib:sounds/music/mini_slow
  3. title @s clear
  4. title @s actionbar ""
  5. # 状态效果
  6. effect clear @s
  7. effect give @s saturation 1000000 0 true
  8. effect give @s instant_health 10 0 true
  9. gamerule naturalRegeneration false
  10. # 设置玩家生命
  11. attribute @s generic.max_health base set 20
  12. # 计分板重置
  13. scoreboard players reset @s kill_phantom
  14. scoreboard players reset @s kill_phantom2
  15. scoreboard players set @s[team=playing,tag=!rejoining] kill_phantom 0
  16. scoreboard players set @s[team=playing,tag=!rejoining] kill_phantom2 0
  17. scoreboard players reset @s use_trident
  18. scoreboard players reset @s countdown
  19. # 传送玩家
  20. tp @s[team=playing] 1030.5 24.5 6031.5
  21. # 清理道具
  22. clear @s #item:game_item{game_item:1b}
  23. clear @s barrier{LockItem:1b}
  24. # 调整模式
  25. gamemode spectator @s[team=!debugging]
  26. gamemode adventure @s[team=playing,tag=!rejoining]
  27. # 重新加入处理
  28. execute if entity @s[tag=rejoining] run gamemode spectator