buy_particle_system.mcfunction 1.5 KB

12345678910111213141516171819
  1. # 粒子系统 (2 eb)
  2. # 触发器ID 100
  3. execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
  4. tag @s remove canbuy
  5. tag @s[scores={shop_particle_s=0,green=18..},tag=!particle] add canbuy
  6. tellraw @s[scores={shop_particle_s=1..},tag=!particle] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功打开 ","color":"aqua"},{"text":"粒子系统","color":"green"}]
  7. tellraw @s[scores={shop_particle_s=1..},tag=particle] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经打开了 ","color":"aqua"},{"text":"粒子系统","color":"green"}]
  8. tellraw @s[scores={shop_particle_s=0,green=..17}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买粒子系统!","color":"red"}]
  9. tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"粒子系统","color":"green"}]
  10. execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"粒子系统","color":"green"}]
  11. scoreboard players add @s[tag=canbuy] shop_particle_s 1
  12. scoreboard players remove @s[tag=canbuy] green 18
  13. execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
  14. execute as @s[scores={shop_particle_s=1..}] at @s run function lib:sounds/levelup
  15. execute as @s[tag=canbuy] run function item:shop/refresh_green
  16. tag @s remove canbuy
  17. # 打开粒子系统
  18. execute as @s[scores={shop_particle_s=1..},tag=!particle] run tag @s add particle