player_enter.mcfunction 942 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # 对单个玩家的处理(如果玩家中途加入就会执行此函数)
  2. function lib:sounds/music/lobby
  3. title @s clear
  4. title @s actionbar ""
  5. # 重置玩家血量上限
  6. attribute @s generic.max_health base set 20
  7. # 重置经验值与配方
  8. recipe take @a *
  9. xp set @s 0 points
  10. xp set @s 0 levels
  11. # 开启触发器
  12. scoreboard players enable @s buy_trigger
  13. # 状态效果
  14. effect clear @s
  15. effect give @s saturation 1000000 0 true
  16. effect give @s instant_health 1 10 true
  17. gamerule naturalRegeneration true
  18. effect give @s resistance 1000000 4 true
  19. effect give @s weakness 1000000 4 true
  20. # 冒险模式
  21. gamemode adventure @s[team=!debugging]
  22. # 传送玩家
  23. tp @s[team=!debugging] -10 8 -32 -113 0
  24. # 刷新物品
  25. clear @s[team=!debugging]
  26. execute as @s[team=!debugging] run function item:shop/refresh_gold
  27. execute as @s[team=!debugging] run function item:shop/refresh_green
  28. # 默认进入待机状态
  29. function ltw:state/0/state/join_watch