Need to make target selector only select one entity
the problem is that @e
and any selectors you use with it can be ambiguous. if literally any other entities with your specified tags exist, it would work with them too, which is why it's throwing the error.
a workaround that i've used is execute as @e
and continued from there, using @s
as my selector at the end of my run
segment. for example;
execute as @e[type=minecraft:area_effect_cloud,tag=sniperaoecloud,name=sniperaoecloud] store result score @s sniperx run data get entity @s
You can also use limit and sort, like so:
execute as @e[type=area_affect_cloud, tag=sniperaoecloud, limit=1, sort=nearest]
If you want @e
to select the next closest entity of the same type, just add distance=.1
.