Started by
TheCatalystGaming
on
Topic category: Help with Minecraft modding (Java Edition)
I'm trying to make a harpoon gun, the advantage of which is supposed to be that the projectile isn't impeded by water. Unfortunately, I don't know how to actually do this. Any help would be appreciated.
If you are willing to change your harpoon to a living entity, you can have it save its horizontal velocities to a NBT tag when it spawns, and then set its velocity to those values every tick.
The tricky part of doing this is making sure your harpoon flies in the right direction originally (once the velocity is saved and repeating, it should continue fine, so the original push is the only hard part).
I haven't tried it to see how it works, but this post might be able to help give that initial push: https://mcreator.net/forum/61838/how-accelerate-player-direction-they-are-looking?page=0
Thats a good idea, I'll try that.
Also the post you linked was posted by me, I ended up figuring that out myself eventually so I should be able to copy what I done with that to the harpoon. Thanks for the help!
Haha! Sorry, I didn't notice. :)
You're welcome!
did work?
I know this is a bit old but heres a code that could help:
protected float getWaterInertia() {
return 0.99F;
}