211_particle.mcfunction 1.4 KB

1234567891011121314151617181920
  1. # 特效 (10e)
  2. scoreboard players add @s shop_particle 0
  3. tag @s remove canbuy
  4. tellraw @s[scores={shop_particle=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的装饰!","color":"red"}]
  5. tellraw @s[scores={shop_particle=0,green=..9}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买这个装饰!","color":"red"}]
  6. tag @s[scores={shop_particle=0,green=10..}] add canbuy
  7. tellraw @s[scores={shop_particle=1..}] ["",{"text":">> ","color":"green","bold":true},"当前装饰已切换为 ",{"text":"星光","color":"green"}]
  8. tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"装饰: 星光","color":"green"}]
  9. execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"装饰: 星光","color":"green"}]
  10. scoreboard players add @s[tag=canbuy] shop_particle 1
  11. scoreboard players remove @s[tag=canbuy] green 10
  12. execute as @s[tag=!canbuy,scores={shop_particle=..0}] at @s run function lib:sounds/error
  13. execute as @s[tag=!canbuy,scores={shop_particle=1..}] at @s run function lib:sounds/hit
  14. execute as @s[tag=canbuy] 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. scoreboard players set @s[scores={shop_particle=1..}] particle_type 1