I do have one that(Projectlies+.js) is made for arrows and can only tp upwards or blockhit before the arrow hits you. Calculating snowball/egg trajectory might be similar as calculating arrow's. Part of the code is adapted from the
Projectiles module from LiquidBounce. If you want one for eggs/snowballs, you can simply change the entity type to eggs/snowballs, and alternate the prediction. And make horizontal teleport. I am just too lazy to do that lol. (Would be grateful if you can make a pull request).
ALSO BEWARE THE CODE IS LICENSED UNDER AGPL-v3, WHICH MEANS YOU CAN'T OBFUSCATE IT BEFORE YOU GIVE IT TO OTHERS. AND IF YOUR WORK USES THE CODE OF IT YOUR WORK MUST BE LICENSED UNDER AGPL-v3 TOO.
ALSO BEWARE THE LICENSE OF LiquidBounce IS GPL-v3.
THOUGH I AM NOT A LAWYER, IN SHORT, THESE WORK MUST BE KEPT OPEN-SOURCED UNLESS IT'S FOR PERSONAL USE.
However, there are problems,I think(not verified) the server updates the arrow's position/velocity in a interval, which makes the trajectory look like this. (Yellow for history trajectory, blue for prediction.). (I am referring to the problem of the two arrows have different trajectory which is supposed to be the same.)
(screen shot from my video)