player_enter.mcfunction 954 B

12345678910111213141516171819202122232425262728293031
  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. effect give @s instant_health 10 0 true
  9. gamerule naturalRegeneration false
  10. effect give @s night_vision 1000000 0 true
  11. # 设置玩家生命
  12. attribute @s generic.max_health base set 20
  13. # 传送玩家
  14. tp @s[tag=!debug] 1002.0 7.5 7002.0
  15. # 重置记分板
  16. scoreboard players reset @s slime_score
  17. scoreboard players set @s[tag=!watcher,tag=!rejoining,tag=!debug] slime_score 0
  18. # 调整模式
  19. gamemode spectator @s[tag=!debug]
  20. gamemode adventure @s[tag=!watcher,tag=!rejoining,tag=!debug]
  21. # 重新加入处理
  22. execute if entity @s[tag=rejoining] run function mini:slime/player_failed
  23. # 给予物品
  24. replaceitem entity @s hotbar.8 stick{game_item:1b,Enchantments:[{id:"knockback",lvl:2}],display:{Name:'{"text":"补给用击退棒","italic":false,"color":"white"}'}} 1