summon2.mcfunction 671 B

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