natives

natives contains a function for extracting natives libraries to a specific folder

extract_natives(version: str, minecraft_directory: str | PathLike, extract_path: str | PathLike) None

Extract all native libraries from a version into the given directory. The directory will be created, if it does not exist.

The natives are all extracted while installing. So you don’t need to use this function in most cases.

Example:

minecraft_directory = minecraft_launcher_lib.utils.get_minecraft_directory()
minecraft_launcher_lib.natives.extract_natives("1.21", minecraft_directory, "/path/to/extract")
Parameters:
  • version (str) – The Minecraft version

  • minecraft_directory (str | PathLike) – The path to your Minecraft directory

  • extract_path (str | PathLike) – The directory to which the native libraries will be extracted

Raises:
Return type:

None

View the source code of this module