install

install allows you to install minecraft.

install_minecraft_version(versionid: str, minecraft_directory: Union[str, PathLike], callback: Optional[CallbackDict] = None) None

Installs a minecraft version into the given path. e.g. install_version("1.14", "/tmp/minecraft"). Use get_minecraft_directory() to get the default Minecraft directory.

Parameters
  • versionid (str) – The Minecraft version

  • minecraft_directory (Union[str, PathLike]) – The path to your Minecraft directory

  • callback (Optional[CallbackDict]) – Some functions that are called to monitor the progress (see below)

Raises
Return type

None

callback is a dict with functions that are called with arguments to get the progress. You can use it to show the progress to the user.

callback = {
    "setStatus": some_function, # This function is called to set a text
    "setProgress" some_function, # This function is called to set the progress.
    "setMax": some_function, # This function is called to set to max progress.
}

Files that are already exists will not be replaced.

View the source code of this module