refresh_green.mcfunction 628 B

1234567891011121314151617
  1. # 刷新单个玩家背包中的绿宝石
  2. scoreboard players add @s green 0
  3. scoreboard players add @s green_total 0
  4. clear @s emerald_block
  5. clear @s emerald
  6. # 获取绿宝石块数,存于 temp
  7. scoreboard players operation @s temp = @s green
  8. scoreboard players operation @s temp /= #9 mem
  9. # 给予绿宝石块
  10. execute if score @s temp matches 1.. at @s run function item:shop/summon_emerald_block
  11. # 获取绿宝石数,存于 temp
  12. scoreboard players operation @s temp = @s green
  13. scoreboard players operation @s temp %= #9 mem
  14. # 给予绿宝石
  15. execute if score @s temp matches 1.. at @s run function item:shop/summon_emerald