refresh_gold.mcfunction 532 B

123456789101112131415
  1. # 刷新单个玩家背包中的金粒
  2. clear @s gold_ingot
  3. clear @s gold_nugget
  4. # 获取金锭数,存于 temp
  5. scoreboard players operation @s temp = @s gold
  6. scoreboard players operation @s temp /= #const_9 mem
  7. # 给予金锭
  8. execute if score @s temp matches 1.. at @s run function ltw:shop/summon_gold
  9. # 获取金粒数,存于 temp
  10. scoreboard players operation @s temp = @s gold
  11. scoreboard players operation @s temp %= #const_9 mem
  12. # 给予金粒
  13. execute if score @s temp matches 1.. at @s run function ltw:shop/summon_nugget