if (mc.player.isSwimming()) { mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.PRESS_SHIFT_KEY)); mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.RELEASE_SHIFT_KEY)); float acceletion = 1.05f; mc.player.setVelocity(mc.player.getMotion().x * acceletion, mc.player.getMotion().y, mc.player.getMotion().z * acceletion); }