2
0

generate_bonus.mcfunction 1.3 KB

1234567891011121314151617181920
  1. # 生成奖励物品
  2. kill @e[type=item]
  3. execute store result score $t_bonus_count mem if entity @a[tag=!watcher]
  4. # scoreboard players add $t_bonus_count mem 1
  5. execute if score $t_bonus_count mem matches 1.. positioned 9.0 12.5 2012.5 run function item:bonus_item/rank/random
  6. execute if score $t_bonus_count mem matches 2.. positioned 5.0 12.5 2012.5 run function item:bonus_item/rank/random
  7. execute if score $t_bonus_count mem matches 3.. positioned 1.5 12.5 2009.0 run function item:bonus_item/rank/random
  8. execute if score $t_bonus_count mem matches 4.. positioned 1.5 12.5 2005.0 run function item:bonus_item/rank/random
  9. execute if score $t_bonus_count mem matches 5.. positioned 5.0 12.5 2001.5 run function item:bonus_item/rank/random
  10. execute if score $t_bonus_count mem matches 6.. positioned 9.0 12.5 2001.5 run function item:bonus_item/rank/random
  11. execute if score $t_bonus_count mem matches 7.. positioned 12.5 12.5 2005.0 run function item:bonus_item/rank/random
  12. execute if score $t_bonus_count mem matches 8.. positioned 12.5 12.5 2009.0 run function item:bonus_item/rank/random
  13. # 生成拾取窗口
  14. execute as @e[type=item] at @s run fill ~-0.2 ~ ~-0.2 ~0.2 ~ ~0.2 air
  15. execute as @e[type=item] at @s run fill ~-0.2 ~1 ~-0.2 ~0.2 ~1 ~0.2 barrier
  16. # 防止幽灵实体,分 tick 执行
  17. schedule function ltw:state/6/generate_bonus2 1t