AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(player.posX, player.posY, player.posZ, player.posX + 1, player.posY + 1, player.posZ + 1).expand(5, 5, 5);
axisalignedbb.maxY = world.getHeight();
List list = world.getEntitiesWithinAABB(Entity.class, axisalignedbb);
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
Entity entity = (Entity) iterator.next();
if(entity != player)
{
double xo = entity.posX - player.posX;
double zo = entity.posZ - player.posZ;
double zv = zo;
double xv = xo;
double x = 1.0D;
if(xo < 0){xv = xo * (-1);}
if(zo < 0){zv = zo * (-1);}
double z = x * zv / xv;
if(xo < 0){x *= (-1);}
if(zo < 0){z *= (-1);}
entity.addVelocity(x, 1.0D, z);
}
}