join_watch.mcfunction 788 B

123456789101112131415
  1. # 清理现有选择物品
  2. clear @s lime_wool{lobby_item:1b}
  3. clear @s light_gray_wool{lobby_item:1b}
  4. kill @e[type=item,nbt={Item:{id:"minecraft:lime_wool",tag:{lobby_item:1b}}}]
  5. # 弹出玩家放在第一格上的物品
  6. execute if data entity @s Inventory[{Slot:0b}] run scoreboard players set @s temp 0
  7. execute if data entity @s Inventory[{Slot:0b}] at @s run function lib:pop_slot/return_item
  8. # 设置新的选择物品
  9. replaceitem entity @s hotbar.0 light_gray_wool{lobby_item:1b,display:{Name:'[{"text":"","color":"white","italic":false},"旁观模式 (按 ",{"keybind":"key.drop"}," 以准备)"]',Lore:['[{"text":"","color":"gray","italic":false},"你将在下一局旁观游戏"]']}}
  10. # 设置队伍
  11. team join hub_watch @s
  12. # 播放音效
  13. execute at @s run function lib:sounds/hit2