execute command at entities around an arrow

730 Views Asked by At

as stated in the title I want to make a arrow that executes a command on all entities in a certain range of the arrow, the range I would like to be 10x10 from the center of the arrow. but I have not been able to get it working.

execute as @e[type=spectral_arrow,tag=ShotFromLightningBow] at @s run execute as @e[tag=!MageAlly,distance=10..10] run effect give @s wither 5 5 true

This is what I tried last.

1

There are 1 best solutions below

2
McModknower On

Your problem is in the distance tag. distance=a..b means the distance to the entity must be between the numbers a and b (both inclusive). In your command both are 10, meaning the effect only gets applied to entities with a distance of exactly 10 blocks. You proboably want to do distance=..a, which means all entities that are at most a blocks away.