Started by
half glaceon
on
Topic category: Help with Minecraft modding (Java Edition)
I'm making a mod but i got stuck at one part: i need to make a weapon that bounces and has gravity, but goes with the same speed when (yes it can)it jumps 1 block, not only that but it to go slower before despawning (despawns at some seconds after spawning). May someone screenshot the procedure for this or how to make it? I REALY need it.
I would start with the following:
When projectile hits block trigger -> override motion vector of the projectile with vx=X velocity, vy= (-1)*Y velocity, vz=Z velocity.
Yeah, something like this sounds pretty difficult. Overriding motion vectors is probably the way to go, but getting it to bounce properly depending on how it hits a surface would be pretty difficult. You could also try making a custom entity for your projectile, or compromise and use the existing small or large fireball entities. (Like the ones from blazes and ghasts).
Looked into it a bit more- Mcreator automatically includes a function that despawns the projectile on impact. Make a Motion-Vector override procedure that triggers when the projectile hits a block, (In your case, something that keeps X and Z velocity, and modifies Y Velocity to a set number), possibly with a function to despawn the projectile after a certain amount of time flying. Then, lock the code, and look for a section of code that says 'When In-Ground, discard,' (or something along those lines), and delete it.
its not working lol
maybe add a named chicken with no ai to the projectile and tp it to the projectile. use the chicken’s bouncing box to make the codes