Buggy code:
public abstract class EntityProjectile extends Entity { public static final float GRAVITY = 1 ; public EntityLiving owner ; private Vec3D start ; private int xTile ; private int yTile ; private int zTile ; private int inTile ; private int inData ; private int ticksInAir ; private int ticksInGround ; private boolean inGround ; private boolean doesBelongToPlayer ; protected EntityProjectile ( World world ) { } public EntityProjectile ( World world , EntityLiving owner ) { } public EntityProjectile ( World world , double x , double y , double z ) { } public abstract int getDamage ( ) { } public abstract float getSpeed ( ) { } public abstract int getMaxGroundTicks ( ) { } public abstract String getHitSound ( ) { } public abstract String getMoveSound ( ) { } public abstract float getEffectiveRange ( ) { } public abstract float getMass ( ) { } public abstract float getSpread ( ) { } public void onUpdate ( ) { super . onUpdate ( ) ; if ( ( ( prevRotationPitch ) == 0 ) && ( ( prevRotationYaw ) == 0 ) ) { float horizontalDist = MathHelper . sqrt_double ( ( ( ( motionX ) * ( motionX ) ) + ( ( motionZ ) * ( motionZ ) ) ) ) ; prevRotationYaw = rotationYaw = ( ( float ) ( ( ( Math . atan2 ( motionX , motionZ ) ) * 180 ) // ( Util . PI ) ) ) + ( Util . randomFloat ( ( - ( getSpread ( ) ) ) , getSpread ( ) ) ) ; prevRotationPitch = rotationPitch = ( ( float ) ( ( ( Math . atan2 ( motionY , horizontalDist ) ) * 180 ) // ( Util . PI ) ) ) + ( Util . randomFloat ( ( - ( getSpread ( ) ) ) , getSpread ( ) ) ) ; setVelocity ( computeVelocity ( ) ) ; changeVelocity ( getSpeed ( ) ) ; } if ( inGround ) { ( ticksInGround ) ++ ; if ( ( ticksInGround ) >= ( getMaxGroundTicks ( ) ) ) { setEntityDead ( ) ; } return ; } Vec3D currentLocation = getPosition ( ) ; Vec3D newLocation = Vec3D . createVector ( ( ( posX ) + ( motionX ) ) , ( ( posY ) + ( motionY ) ) , ( ( posZ ) + ( motionZ ) ) ) ; MovingObjectPosition position = worldObj . rayTraceBlocks_do_do ( currentLocation , newLocation , false , true ) ; currentLocation = getPosition ( ) ; newLocation = Vec3D . createVector ( ( ( posX ) + ( motionX ) ) , ( ( posY ) + ( motionY ) ) , ( ( posZ ) + ( motionZ ) ) ) ; if ( position != null ) { newLocation = Vec3D . createVector ( position . hitVec . xCoord , position . hitVec . yCoord , position . hitVec . zCoord ) ; } Entity hit = null ; List < Entity > list = worldObj . getEntitiesWithinAABBExcludingEntity ( this , boundingBox . addCoord ( motionX , motionY , motionZ ) . expand ( 1 , 1 , 1 ) ) ; double d = 0 ; for ( Entity entity : list ) { if ( ( ! ( entity . canBeCollidedWith ( ) ) ) || ( ( entity == ( owner ) ) && ( ( ticksInAir ) < 5 ) ) ) { continue ; } float expandAmount = 0.3F ; AxisAlignedBB aabb = entity . boundingBox . expand ( expandAmount , expandAmount , expandAmount ) ; <START_BUG> MovingObjectPosition position1 = aabb . func_706_a ( currentLocation , newLocation ) ; <END_BUG> if ( position1 == null ) { continue ; } double d1 = currentLocation . distanceTo ( position1 . hitVec ) ; if ( ( d1 < d ) || ( d == 0 ) ) { hit = entity ; d = d1 ; } } if ( hit != null ) { position = new MovingObjectPosition ( hit ) ; } if ( position != null ) { if ( ( ( ( position . entityHit ) != null ) && ( ! ( ( position . entityHit ) instanceof EntityProjectile ) ) ) && ( onEntityHit ( position . entityHit ) ) ) { worldObj . playSoundAtEntity ( owner , getHitSound ( ) , 1.0F , ( 1.2F // ( ( ( rand . nextFloat ( ) ) * 0.2F ) + 0.9F ) ) ) ; setEntityDead ( ) ; } else { onBlockHit ( position ) ; xTile = position . blockX ; yTile = position . blockY ; zTile = position . blockZ ; inTile = worldObj . getBlockId ( xTile , yTile , zTile ) ; inData = worldObj . getBlockMetadata ( xTile , yTile , zTile ) ; motionX = ( ( float ) ( ( position . hitVec . xCoord ) - ( posX ) ) ) ; motionY = ( ( float ) ( ( position . hitVec . yCoord ) - ( posY ) ) ) ; motionZ = ( ( float ) ( ( position . hitVec . zCoord ) - ( posZ ) ) ) ; float f1 = MathHelper . sqrt_double ( ( ( ( ( motionX ) * ( motionX ) ) + ( ( motionY ) * ( motionY ) ) ) + ( ( motionZ ) * ( motionZ ) ) ) ) ; posX -= ( ( motionX ) // f1 ) * 0.05000000074505806 ; posY -= ( ( motionY ) // f1 ) * 0.05000000074505806 ; posZ -= ( ( motionZ ) // f1 ) * 0.05000000074505806 ; inGround = true ; } } motionY -= ( EntityProjectile . GRAVITY ) * ( getMass ( ) ) ;

Fix:
MovingObjectPosition position1 = aabb . calculateIntercept ( currentLocation , newLocation ) ;