random.mcfunction 683 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/mixed/white
  10. # 绿色:30%
  11. execute if score #quality mem matches 50..79 run function item:bonus_item/gameparty/mixed/green
  12. # 蓝色:15%
  13. execute if score #quality mem matches 80..95 run function item:bonus_item/gameparty/mixed/blue
  14. # 紫色:5%
  15. execute if score #quality mem matches 96.. run function item:bonus_item/gameparty/mixed/purple