1

Negating Fall Damage with Forge/ModLoader

Surseance's Avatar Surseance12/20/12 8:16 pm
1 emeralds 1.2k
Well, it turns out, this will be a simpler fix than you guys would think. All one has to do is just look at the EntityPlayer class logically. When the fallDistance float is initialized, it is not public (at least I don't think so), so you must create a public instance of the float within your file. Simply add this line to the top of your mod class:

public float fallDistance;

That grabs a public instance of the float. Now, you can just use the same float to negate the fall damage as you've already known how to do:

player.fallDistance = 0.0F;

And that's it! Thanks for reading this, and if you have any trouble, feel free to PM me. Happy modding! (And Merry Christmas!)
Posted by Surseance's Avatar
Surseance
Level 67 : High Grandmaster Modder
288

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome