tick20.mcfunction 1.6 KB

123456789101112131415161718192021222324252627
  1. # 随机召唤怪物
  2. # 生成随机数
  3. scoreboard players set $random_min mem 0
  4. scoreboard players set $random_max mem 100
  5. function lib:random
  6. # 清理恼鬼
  7. execute if score $random mem matches 50.. run tp @e[type=vex,limit=1,sort=random] ~ -100 ~
  8. # 赋予随机效果
  9. effect give @e[type=!player,type=!piglin,limit=1,sort=random] speed 1 1
  10. effect give @e[type=!player,type=!piglin,limit=1,sort=random] speed 4 0
  11. effect give @e[type=piglin,limit=1,sort=random] slowness 3 0
  12. effect give @e[type=piglin,limit=1,sort=random] slowness 3 1
  13. effect give @e[type=!player,limit=2,sort=random] resistance 3 1
  14. # 召唤怪物
  15. execute if score $countdown mem matches 61..120 if score $random mem matches 0..10 run function mini:zombie/game/summon_piglin
  16. execute if score $countdown mem matches 1..90 if score $random mem matches 11..20 run function mini:zombie/game/summon_skeleton
  17. execute if score $countdown mem matches ..60 if score $random mem matches 21..30 run function mini:zombie/game/summon_creeper
  18. execute if score $countdown mem matches ..0 if score $random mem matches 31..40 run function mini:zombie/game/summon_evoker
  19. # 显示提示
  20. execute if score $countdown mem matches 90 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "骷髅 ","color":"red"},"已开始出现!"]
  21. execute if score $countdown mem matches 60 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "苦力怕 ","color":"red"},"已开始出现!"]
  22. execute if score $countdown mem matches 1 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "唤魔者 ","color":"red"},"已开始出现!"]