In 1.12, I had a command block to summon in minecarts on a single point. I then had another command to spread the minecarts out in a radius of 20 blocks, and a following chain command block to teleport them to the y level 64, because the spreadplayers command teleports entities to the highest solid block. The chained command was simply:
tp @e[type=minecart,r=30] ~ 64 ~
In 1.13, this now teleports all the minecarts to point point. I tried
execute at @e[type=minecart,distance=..30] as @e[type=minecart,distance=..30] run tp @s ~ 64 ~
but this does not work, it has the same effect (Teleporting them all on top of eachother). I also replaced @s with @e[type=minecart,distance=..30] to no avail. Any solutions here?