random.mcfunction 692 B

12345678910111213141516
  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 $t_quality mem = $random mem
  7. # 根据品质生成不同的物品
  8. execute if score $t_quality mem matches ..24 run function item:bonus_item/gameparty/last/white
  9. # 绿色:35%
  10. execute if score $t_quality mem matches 25..59 run function item:bonus_item/gameparty/last/green
  11. # 蓝色:25%
  12. execute if score $t_quality mem matches 60..84 run function item:bonus_item/gameparty/last/blue
  13. # 紫色:15%
  14. execute if score $t_quality mem matches 85.. run function item:bonus_item/gameparty/last/purple