mrpack
mrpack allows you to install Modpacks from the Mrpack Format. You should also take a look at the complete example.
- get_mrpack_information(path: str | PathLike) MrpackInformation
Gets some Information from a .mrpack file
Example:
path = "/path/to/mrpack" information = minecraft_launcher_lib.mrpack.get_mrpack_information(path) print("Name: " + information["name"]) print("Summary: " + information["summary"])
- Parameters:
path (Union[str, os.PathLike]) – The Path the the .mrpack file
- Returns:
The Information about the given Mrpack
- Return type:
- install_mrpack(path: str | PathLike, minecraft_directory: str | PathLike, modpack_directory: str | PathLike | None = None, callback: CallbackDict | None = None, mrpack_install_options: MrpackInstallOptions | None = None) None
Installs a .mrpack file
mrpack_install_optionsis a dict. All Options are Optional.mrpack_install_options = { "optionalFiles": [], # List with all Optional files "skipDependenciesInstall": False # If you want to skip the Dependencies install. Only used for testing purposes. }
Example:
path = "/path/to/mrpack" minecraft_directory = minecraft_directory.utils.get_minecraft_directory() minecraft_launcher_lib.mrpack.install_mrpack(path, minecraft_directory)
- Parameters:
path (str | PathLike) – The Path the the .mrpack file
minecraft_directory (str | PathLike) – he path to your Minecraft directory
modpack_directory (str | PathLike | None) – If you want to install the Pack in another Directory than your Minecraft directory, set it here.
callback (CallbackDict | None) – The same dict as for
install_minecraft_version()mrpack_install_options (MrpackInstallOptions | None) – Some Options to install the Pack (see below)
- Raises:
FileOutsideMinecraftDirectory – A File should be placed outside the given Minecraft directory
- Return type:
None
- get_mrpack_launch_version(path: str | PathLike) str
Returns that Version that needs to be used with
get_minecraft_command().Example:
path = "/path/to/mrpack" print("Launch version: " + minecraft_launcher_lib.mrpack.get_mrpack_launch_version(path))
- Parameters:
path (str | PathLike) – The Path the the .mrpack file
- Returns:
The version
- Return type:
str