tick20.mcfunction 1.2 KB

12345678910111213141516171819
  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 61.. run effect give @e[tag=mini_mob,limit=3,sort=random] slowness 2 0
  8. execute if score $countdown mem matches 91.. run effect give @e[tag=mini_mob,limit=1,sort=random] slowness 2 1
  9. # 召唤猪灵
  10. execute if score $random mem matches 1..15 if score $countdown mem matches 1.. run function mini:zombie/game/summon_empty
  11. execute if score $random mem matches 1..15 if score $countdown mem matches ..0 as @e[tag=empty_pig,limit=1,sort=random] run function mini:zombie/game/give_equip
  12. execute if score $random mem matches 1..15 if score $countdown mem matches ..0 unless entity @e[tag=empty_pig] run function mini:zombie/game/summon_equip
  13. # 显示提示
  14. execute if score $countdown mem matches 60 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "猪灵摆脱了缓慢的束缚!","color":"red"}]
  15. execute if score $countdown mem matches 0 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "猪灵取回了他们的装备!","color":"red"}]