summon2.mcfunction 1.4 KB

1234567891011121314151617181920212223242526
  1. execute as @e[tag=new_phantom] at @s run tp @s ~ 33 ~
  2. # 设置攻击力与随机生命值
  3. attribute @e[tag=new_phantom,limit=1] generic.max_health base set 2
  4. attribute @e[tag=new_phantom,limit=1] generic.attack_damage base set 4
  5. # 如果满足条件(在 tick20 中检查),则刷出奖励幻翼
  6. execute if score #new_item mem matches 0 run title @a subtitle {"text":"❇ 击杀红色幻翼, 获取奖励物资 ❇","color":"red"}
  7. execute if score #new_item mem matches 0 run title @a times 1 80 3
  8. execute if score #new_item mem matches 0 run title @a title ""
  9. execute if score #new_item mem matches 0 run playsound minecraft:entity.player.levelup player @a 0 1000000 0 1000000 2
  10. execute if score #new_item mem matches 0 run tag @e[tag=new_phantom] add bonus_phantom
  11. execute if score #new_item mem matches 0 run scoreboard players set $new_item_cd mem 0
  12. # 修改奖励幻翼的属性
  13. team join red @e[tag=bonus_phantom,tag=new_phantom,limit=1]
  14. effect give @e[tag=bonus_phantom,tag=new_phantom,limit=1] glowing 1000000 0 true
  15. data merge entity @e[tag=bonus_phantom,tag=new_phantom,limit=1] {Size:7,DeathLootTable:"mini:phantom"}
  16. attribute @e[tag=bonus_phantom,tag=new_phantom,limit=1] generic.attack_damage base set 8
  17. attribute @e[tag=bonus_phantom,tag=new_phantom,limit=1] generic.max_health base set 20
  18. # 确认属性修改
  19. effect give @e[tag=new_phantom] instant_damage 1 10 true
  20. tag @e[tag=new_phantom] remove new_phantom