Request: Allow gravity to work for entity projectile spells
Hi Nathan,
It would be awesome of gravity worked on entity projectiles from the class: Projectile action. Wondering if this could be added potentially. I think it could diversify what people do with them quite a lot which would be nice. I'm imagining a zero gravity thrown trident or a spray of higher gravity snowballs which do explosion damage etc. No worries if your too busy for that just an idea.
Thanks
- Mineshaft
Have you tried using EntityProjectile instead? I wonder if you could use that with a projectile-type entity to get the same effect. I have no idea if that'll work though :)
The Projectile class just launches a vanilla projectile and has no control over what happens after that, so implementing gravity there isn't really an option- but EntityProjectile is built on CustomProjectile, so it's possible that'd work by constantly re-adjusting the velocity (or teleporting, if use you teleport: true`) of the projectile entity.
It's worth a try at least, I'm thinking it may be a little glitchy though since the server will be trying to move the projectile via vanilla projectile logic while the plugin is also moving it.
Have you tried using
EntityProjectileinstead? I wonder if you could use that with a projectile-type entity to get the same effect. I have no idea if that'll work though :)The
Projectileclass just launches a vanilla projectile and has no control over what happens after that, so implementing gravity there isn't really an option- butEntityProjectileis built onCustomProjectile, so it's possible that'd work by constantly re-adjusting the velocity (or teleporting, if use youteleport: true`) of the projectile entity.It's worth a try at least, I'm thinking it may be a little glitchy though since the server will be trying to move the projectile via vanilla projectile logic while the plugin is also moving it.
Many thanks Nathan sorry i must of missed that action! Your right that one allows me to adjust the gravity and i have to say the entities actually travel very smoothly, the Cannons plugin shoots the same entities but it judders a lot but for some reason Magic ones dont! The only thing i cant work out is how to attach particles/effects to the projectile like i have with regular class: projectile spells. Stuff like tick and projectile as effects dont seem to work and the effects are only seemingly played at my caster. Even the hit particle effects play at me the caster. My target is set to none, but that didn't cause issues with the Projectile spell i had. Not sure if this is a bug?
Just so you know what i mean this is the spell im tinkering with: https://pastebin.com/KbvbuuWC