natives — minecraft-launcher-lib 8.0 documentation

# 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:

    - VersionNotFound – The Minecraft version was not found

    - FileOutsideMinecraftDirectory – A File should be placed outside the given Minecraft directory

  Return type:

    None

View the source code of this module