buy_particle2.mcfunction 1.8 KB

123456789101112131415161718192021
  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_2=0,green=3..},tag=particle] add canbuy
  6. tellraw @s[scores={shop_particle_2=1..},tag=!show_particle_2] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功切换 ","color":"aqua"},{"text":"素雅粒子","color":"green"}]
  7. tellraw @s[scores={shop_particle_2=1..},tag=show_particle_2] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经激活了 ","color":"aqua"},{"text":"素雅粒子","color":"green"}]
  8. tellraw @s[scores={shop_particle_2=0,green=..2}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买这个粒子!","color":"red"}]
  9. tellraw @s[tag=!particle] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买粒子效果系统!","color":"red"}]
  10. tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"素雅粒子","color":"green"}]
  11. execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"素雅粒子","color":"green"}]
  12. scoreboard players add @s[tag=canbuy] shop_particle_2 1
  13. scoreboard players remove @s[tag=canbuy] green 3
  14. execute as @s[scores={shop_particle_2=0}] at @s run function lib:sounds/error
  15. execute as @s[scores={shop_particle_2=1..}] at @s run function lib:sounds/levelup
  16. execute as @s[tag=canbuy] run function item:shop/refresh_green
  17. tag @s remove canbuy
  18. # 切换粒子
  19. execute as @s[scores={shop_particle_2=1..},tag=!show_particle_2] run function item:particle/reset_particle
  20. execute as @s[scores={shop_particle_2=1..},tag=!show_particle_2] run tag @s add show_particle_2