random.mcfunction 687 B

1234567891011121314151617
  1. # 生成随机品质的物品
  2. # 品质 = d100
  3. scoreboard players set $random_min mem 1
  4. scoreboard players set $random_max mem 100
  5. function lib:random
  6. scoreboard players operation #quality mem = $random mem
  7. # 根据品质生成不同的物品
  8. # 白色:50%
  9. execute if score #quality mem matches ..50 run function item:bonus_item/gameparty/normal/white
  10. # 绿色:30%
  11. execute if score #quality mem matches 51..80 run function item:bonus_item/gameparty/normal/green
  12. # 蓝色:20%
  13. execute if score #quality mem matches 81.. run function item:bonus_item/gameparty/normal/blue
  14. # 紫色:0%
  15. # execute if score #quality mem matches 95.. run function item:bonus_item/gameparty/normal/purple