whcwdsj
原方案:summon minecraft:armor_stand ~ ~1 ~ {Tags:["s18"],Invisible:1,Marker:1}

data modify entity @e[tag=s18,limit=1] Rotation set from entity @e[tag=26,limit=1] Rotation

execute as @e[tag=s18] at @s run tp @s ^ ^ ^2

execute as @e[tag=26] at @s anchored eyes run summon minecraft:fireball ~ ~1.5 ~ {Tags:["s19"],ExplosionPower:2}

data modify entity @e[tag=s19,limit=1] Motion set from entity @e[tag=s18,limit=1] Pos

5个红时刻后:

kill @e[tag=s18]



但火球只能呆在原地不动

tag=26为演示实体



Muggle2077
本帖最后由 Muggle2077 于 2022-12-20 12:25 编辑

以下命令可以使所有盔甲架都召唤一个 power 为 0.1,Motion 为 1.6 的向前运动的火球。

  1. execute as @e[type=minecraft:armor_stand] at @s anchored eyes positioned ^ ^ ^ run function foo:summon
复制代码


函数 foo:summon

  1. summon minecraft:fireball ~ ~ ~ {Tags:["fireball"]}
  2. summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["marker"]}
  3. execute as @e[type=minecraft:area_effect_cloud,tag=marker,distance=..0.01] positioned 0.0 0.0 0.0 run function foo:motion
复制代码

函数 foo:motion

  1. tp @s ^ ^ ^0.1
  2. data modify entity @e[type=minecraft:fireball,tag=fireball,limit=1] power set from entity @s Pos
  3. tp @s ^ ^ ^1.6
  4. data modify entity @e[type=minecraft:fireball,tag=fireball,limit=1] Motion set from entity @s Pos
  5. tag @e[type=minecraft:fireball,tag=fireball] remove fireball
  6. kill @s
复制代码

第一页 上一页 下一页 最后一页