103_pig.mcfunction 613 B

12345678910
  1. # 哼唧 (1gn)
  2. tag @s remove canbuy
  3. tag @s[scores={gold=1..}] add canbuy
  4. tellraw @s[scores={gold=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金粒来购买这个物品!","color":"red"}]
  5. tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"哼?","color":"green"}]
  6. execute at @s run playsound entity.pig.ambient ambient @s 0 1000000 0 1000000
  7. scoreboard players remove @s[tag=canbuy] gold 1
  8. execute as @s[tag=!canbuy] at @s run function lib:sounds/error
  9. execute as @s[tag=canbuy] run function item:shop/refresh_gold
  10. tag @s remove canbuy