buy_particle5.mcfunction 1.8 KB

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