Skip to content

DownloadAssetsEvent

Gets fired every time a new asset file has been downloaded.

progressdouble

The overall download progress as a value from 0.0 to 1.0

downloadedByteslong

The total number of bytes downloaded so far.

totalByteslong

The total size of all assets in bytes.

currentFileString

The name or path of the asset currently being downloaded.

currentFileByteslong

The number of bytes downloaded for the current file.

currentFileSizelong

The total size of the current file in bytes.

AssetDownloader downloads assets across a worker pool sized by LaunchConfiguration.downloadThreads (5 by default), so this event fires concurrently from multiple threads - one post per finished file, plus one final call once every future in the pool has completed to guarantee a progress: 1.0 event even if the last file was tiny.

Because progress/downloadedBytes/totalBytes describe the overall asset download (not just currentFile), don’t assume events arrive in a strict order by file - two threads can post around the same time with currentFile referring to whichever file each thread just finished. If you’re rendering a single progress bar, key off progress; if you want a live “currently downloading” list, track currentFile per listener call rather than assuming monotonic ordering.

This event is only posted when a non-null LaunchContext is available, which is always the case when assets are downloaded as part of Launcher.launchMinecraft(...).