how could i create a beam of particles from posA to posB?

what the title says. i have no idea how to do this. If there's an API that'd let me do this i'd be glad to know, even if it's modded, i just need a way around this.
Continue to help post