Skip to content

Instantly share code, notes, and snippets.

@falkreon
Created December 14, 2015 16:34
Show Gist options
  • Save falkreon/e8ac6091ae2063293da3 to your computer and use it in GitHub Desktop.
Save falkreon/e8ac6091ae2063293da3 to your computer and use it in GitHub Desktop.
@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