summon2.mcfunction 893 B

12345678910111213141516
  1. execute as @e[tag=new_phantom] at @s run tp @s ~ 35 ~
  2. # 随机生命值
  3. scoreboard players set $random_min mem 0
  4. scoreboard players set $random_max mem 4
  5. function lib:random
  6. execute if score $random mem matches 0 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 2
  7. execute if score $random mem matches 1 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 3
  8. execute if score $random mem matches 2 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 4
  9. execute if score $random mem matches 3 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 5
  10. execute if score $random mem matches 4 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 6
  11. attribute @e[tag=new_phantom,limit=1] generic.attack_damage base set 4
  12. effect give @e[tag=new_phantom] instant_damage
  13. tag @e[tag=new_phantom] remove new_phantom