Events/Launch/minified-launch

DownloadClientJarEvent

Gets fired while the Minecraft client JAR is being downloaded

Fields

progressdouble

The overall download progress as a value from 0.0 to 1.0

Accessor: progress()
downloadedByteslong

The number of bytes downloaded so far

Accessor: downloadedBytes()
totalByteslong

The total size of the client JAR in bytes

Accessor: totalBytes()

When it fires

ClientDownloader posts this event on every chunk read from the HTTP response body (there's no throttling like the Java runtime downloader has), plus one guaranteed final call with progress: 1.0. Since it comes from a single sequential InputStream read loop, unlike the asset/library events, these always arrive in order on one thread.

Two cases where you won't see this event fire during a normal launch:

Listening

Subscribe on the EventBus the event is posted to, see Events for which bus that is.

eventBus.subscribe(DownloadClientJarEvent.class, event -> {
    double progress = event.progress();
    long downloadedBytes = event.downloadedBytes();
    long totalBytes = event.totalBytes();
});

Posted by

API reference: com.dervarex.minified.launch.events.download.client.DownloadClientJarEvent