tick20.mcfunction 2.9 KB

123456789101112131415161718192021222324252627282930313233
  1. # 随机召唤怪物
  2. # 生成随机数
  3. scoreboard players set $random_min mem 1
  4. scoreboard players set $random_max mem 100
  5. function lib:random
  6. # 赋予缓慢效果
  7. execute if score $countdown mem matches ..30 run effect give @e[tag=mini_mob,limit=2,sort=random] speed 2 1
  8. execute if score $countdown mem matches ..80 run effect give @e[tag=mini_mob,limit=2,sort=random] resistance 2 1
  9. execute if score $countdown mem matches ..105 run effect give @e[tag=mini_mob,limit=1,sort=random] speed 2 0
  10. execute if score $countdown mem matches 131..170 run effect give @e[tag=mini_mob,limit=3,sort=random] slowness 2 0
  11. # 显示提示
  12. execute if score $countdown mem matches 155 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "补给物资已经送达!","color":"aqua"}]
  13. execute if score $countdown mem matches 130 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "猪灵开始摆脱缓慢的束缚了!","color":"red"}]
  14. execute if score $countdown mem matches 105 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "补给物资已经送达!","color":"aqua"}]
  15. execute if score $countdown mem matches 80 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "猪灵开始取回他们的装备了!","color":"red"}]
  16. execute if score $countdown mem matches 80 run scoreboard players set $random mem 1
  17. # execute if score $countdown mem matches 55 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "补给物资已经送达!","color":"aqua"}]
  18. # 召唤猪灵
  19. execute if score $random mem matches ..10 if score $countdown mem matches 81.. run function mini:zombie/game/summon_empty
  20. execute if score $random mem matches ..20 if score $countdown mem matches ..80 unless entity @e[tag=empty_pig] run function mini:zombie/game/summon_equip
  21. execute if score $random mem matches ..20 if score $countdown mem matches ..80 as @e[tag=empty_pig,limit=1,sort=random] run function mini:zombie/game/give_equip
  22. execute if score $random mem matches 21..30 if score $countdown mem matches ..5 unless entity @e[tag=empty_pig] run function mini:zombie/game/summon_equip
  23. execute if score $random mem matches 21..30 if score $countdown mem matches ..5 as @e[tag=empty_pig,limit=1,sort=random] run function mini:zombie/game/give_equip
  24. # 生成奖励
  25. execute if score $random mem matches ..50 if score $countdown mem matches 155 run execute positioned 1015.5 11.0 5022.0 run function item:bonus_item/gameparty/auto/white
  26. execute if score $random mem matches 51.. if score $countdown mem matches 155 run execute positioned 1005.5 11.0 5004.0 run function item:bonus_item/gameparty/auto/white
  27. execute if score $random mem matches ..50 if score $countdown mem matches 105 run execute positioned 1015.5 11.0 5022.0 run function item:bonus_item/gameparty/auto/white
  28. execute if score $random mem matches 51.. if score $countdown mem matches 105 run execute positioned 1005.5 11.0 5004.0 run function item:bonus_item/gameparty/auto/white