player_enter.mcfunction 595 B

123456789101112131415161718192021222324252627
  1. # 对单个玩家的处理(如果玩家中途加入就会执行此函数)
  2. function lib:sounds/music/hub
  3. title @s clear
  4. title @s actionbar ""
  5. # 清理物品
  6. clear @s[tag=!debug]
  7. # 重置玩家血量上限
  8. attribute @s generic.max_health base set 20
  9. # 重置经验值
  10. xp set @s 0 points
  11. xp set @s 0 levels
  12. # 状态效果
  13. effect clear @s
  14. effect give @s saturation 1000000 0 true
  15. gamerule naturalRegeneration true
  16. effect give @s night_vision 1000000 0 true
  17. effect give @s resistance 1000000 4 true
  18. # 冒险模式
  19. gamemode adventure @s[tag=!debug]
  20. # 传送玩家
  21. tp @s[tag=!debug] 10 16 10