pm_check.mcfunction 784 B

123456789101112131415
  1. # 计算应有土豆数量
  2. execute if score $player_alive mem matches 6..8 run scoreboard players set $potato_count mem 3
  3. execute if score $player_alive mem matches 4..5 run scoreboard players set $potato_count mem 2
  4. execute if score $player_alive mem matches 2..3 run scoreboard players set $potato_count mem 1
  5. execute if score $player_alive mem matches 1 run scoreboard players set $potato_count mem 0
  6. # 计算当前土豆数量
  7. execute store result score $current_potato mem if entity @a[tag=pm_holding]
  8. # 计算需求土豆数量
  9. scoreboard players operation $new_potato_count mem = $potato_count mem
  10. scoreboard players operation $new_potato_count mem -= $current_potato mem
  11. # 生成土豆
  12. execute if score $new_potato_count mem matches 1.. run function mini:hotpm/game/pm_init