buy_particle2.mcfunction 1.7 KB

123456789101112131415161718192021222324
  1. # 素雅粒子 (3 e)
  2. # 触发器ID 104
  3. execute unless entity @s[scores={shop_particle_2=0..}] run scoreboard players set @s shop_particle_2 0
  4. tag @s remove canbuy
  5. tag @s[scores={shop_particle_s=1..,shop_particle_2=0,green=3..}] add canbuy
  6. tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹特效才能切换尾迹种类!","color":"red"}]
  7. execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
  8. tellraw @s[scores={shop_particle_s=1..,shop_particle_2=1..}] ["",{"text":">> ","color":"aqua","bold":true},"尾迹特效已切换为 ",{"text":"素雅","color":"aqua"}]
  9. execute as @s[scores={shop_particle_s=1..,shop_particle_2=1..}] at @s run function lib:sounds/hit
  10. tellraw @s[scores={shop_particle_s=1..,shop_particle_2=0,green=..2}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买它!","color":"red"}]
  11. execute as @s[scores={shop_particle_s=1..,shop_particle_2=0,green=..2}] at @s run function lib:sounds/error
  12. tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你已购买并切换尾迹特效为 ",{"text":"素雅","color":"green"}]
  13. execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"素雅尾迹","color":"green"}]
  14. scoreboard players add @s[tag=canbuy] shop_particle_2 1
  15. scoreboard players remove @s[tag=canbuy] green 3
  16. execute as @s[tag=canbuy] run function item:shop/refresh_green
  17. execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
  18. tag @s remove canbuy
  19. scoreboard players set @s[scores={shop_particle_2=1..}] particle_type 2