How would you go about creating an chestplate that allows you to fly while it's on? I've created a basic set of armor and tools, but I'm not exactly sure how I should go about implementing this. If somebody could walk me through this, it would be much appreciated.
Sorry for the lack of detail, I'm quite new to the modding scene and all of this is quite overwhelming. Thanks a ton!
I think the easiest way would be to override the onArmorTick() method in your armor class, and manipulate the player's movement from there (for example via the player.setMotion() method).
Walking on fluid is easy, something like this code should work:
if (world.getFluidState(player.getPosition().down()).getFluid() == Fluids.LAVA) { // Check if lava is below the player
Vector3d motion = player.getMotion();
if (motion.y < 0)
motion = motion.mul(1, 0, 1); // Stop the player from falling into the lava
player.setMotion(motion);
}
How would you go about creating an chestplate that allows you to fly while it's on? I've created a basic set of armor and tools, but I'm not exactly sure how I should go about implementing this. If somebody could walk me through this, it would be much appreciated.
Sorry for the lack of detail, I'm quite new to the modding scene and all of this is quite overwhelming. Thanks a ton!
I think the easiest way would be to override the onArmorTick() method in your armor class, and manipulate the player's movement from there (for example via the player.setMotion() method).
Here is how the Iron Jetpacks mod does it.
Thanks a ton! Is there similar mod with open-source code to make it so that you can walk on lava?
Walking on fluid is easy, something like this code should work: