DownloadClientJarEvent
Gets fired while the Minecraft client JAR is being downloaded.
Fields
Section titled “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
Section titled “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.