Events/Launch/minified-launch
DownloadClientJarEvent
Gets fired while the Minecraft client JAR is being downloaded
Fields
progressdoubleThe overall download progress as a value from 0.0 to 1.0
downloadedByteslongThe number of bytes downloaded so far
totalByteslongThe total size of the client JAR in bytes
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:
- The cached JAR is already valid. If
pathexists and its SHA-1 matches the expected checksum fromVersionMetadataProvider,ClientDownloaderskips straight to a singleprogress: 1.0event without downloading anything. - Offline mode.
Launcher.launchMinecraft(...)only callsdownloadClient(...)whencontext.isOnline()is true; in offline mode it either reuses the cached JAR silently or throwsOfflineModeNeedsNetworkExceptionif none exists - neither path posts this event.
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();
});eventBus.subscribe(DownloadClientJarEvent::class.java) { event ->
val progress = event.progress()
val downloadedBytes = event.downloadedBytes()
val totalBytes = event.totalBytes()
}Posted by
API reference: com.dervarex.minified.launch.events.download.client.DownloadClientJarEvent