Created
December 14, 2015 16:34
-
-
Save falkreon/e8ac6091ae2063293da3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { | |
if (entity.isCollidedHorizontally) { | |
entity.motionY = 0.35; | |
} else if (entity.isSneaking()) { | |
entity.motionY = 0.08; //Stop, but also counteract EntityLivingBase-applied microgravity | |
} else if (entity.motionY<-0.20) { | |
entity.motionY = -0.20; | |
} | |
entity.fallDistance = 0.0f; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment