new_item.mcfunction 1.5 KB

123456789101112131415161718192021222324
  1. scoreboard players set $new_item_cd mem 0
  2. # 随机选择生成组
  3. scoreboard players set $random_min mem 0
  4. scoreboard players set $random_max mem 3
  5. function lib:random
  6. # 生成物资
  7. execute if score $random mem matches 0 positioned 1023.5 21 7009.5 run function item:bonus_item/gameparty/auto/low
  8. execute if score $random mem matches 0 positioned 1008.5 21 7024.5 run function item:bonus_item/gameparty/auto/low
  9. execute if score $random mem matches 1 positioned 1008.5 21 7009.5 run function item:bonus_item/gameparty/auto/low
  10. execute if score $random mem matches 1 positioned 1023.5 21 7024.5 run function item:bonus_item/gameparty/auto/low
  11. execute if score $random mem matches 2 positioned 1007.0 21 7016.5 run function item:bonus_item/gameparty/auto/low
  12. execute if score $random mem matches 2 positioned 1025.0 21 7017.5 run function item:bonus_item/gameparty/auto/low
  13. execute if score $random mem matches 3 positioned 1016.5 21 7026.0 run function item:bonus_item/gameparty/auto/low
  14. execute if score $random mem matches 3 positioned 1015.5 21 7008.0 run function item:bonus_item/gameparty/auto/low
  15. execute as @e[tag=bonus_item] run data modify entity @s NoGravity set value 0b
  16. # 显示提示
  17. title @a subtitle {"text":"❇ 奖励物资已在空中部署 ❇","color":"aqua"}
  18. title @a times 1 60 3
  19. title @a title ""
  20. tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text":"奖励物资:","color":"aqua"},{"selector": "@e[tag=bonus_item]"}]
  21. playsound minecraft:entity.player.levelup player @a 0 1000000 0 1000000 2