fabric — minecraft-launcher-lib 8.0 documentation

# fabric

Warning

This module is deprecated and has been replaced by `mod_loader`. It will no longer receive updates or bug fixes and may be removed in a future release.

fabric contains functions for dealing with the Fabric modloader.

get_all_minecraft_versions() → list[FabricMinecraftVersion]

  Returns all available Minecraft Versions for Fabric

  Example:

      for version in minecraft_launcher_lib.fabric.get_all_minecraft_versions():
          print(version["version"])

  Return type:

    list[FabricMinecraftVersion]

get_stable_minecraft_versions() → list[str]

  Returns a list which only contains the stable Minecraft versions that supports Fabric

  Example:

      for version in minecraft_launcher_lib.fabric.get_stable_minecraft_versions():
          print(version)

  Return type:

    list[str]

get_latest_minecraft_version() → str

  Returns the latest unstable Minecraft versions that supports Fabric. This could be a snapshot.

  Example:

      print("Latest Minecraft version: " + minecraft_launcher_lib.fabric.get_latest_minecraft_version())

  Return type:

    str

get_latest_stable_minecraft_version() → str

  Returns the latest stable Minecraft version that supports Fabric

  Example:

      print("Latest stable Minecraft version: " + minecraft_launcher_lib.fabric.get_latest_stable_minecraft_version())

  Return type:

    str

is_minecraft_version_supported(version: str) → bool

  Checks if a Minecraft version supported by Fabric

  Example:

      version = "1.20"
      if minecraft_launcher_lib.fabric.is_minecraft_version_supported(version):
          print(f"{version} is supported by fabric")
      else:
          print(f"{version} is not supported by fabric")

  Parameters:

    version (str) – A vanilla version

  Return type:

    bool

get_all_loader_versions() → list[FabricLoader]

  Returns all loader versions

  Example:

      for version in minecraft_launcher_lib.fabric.get_all_loader_versions():
          print(version["version"])

  Return type:

    list[FabricLoader]

get_latest_loader_version() → str

  Get the latest loader version

  Example:

      print("Latest loader version: " + minecraft_launcher_lib.fabric.get_latest_loader_version())

  Return type:

    str

get_latest_installer_version() → str

  Returns the latest installer version

  Example:

      print("Latest installer version: " + minecraft_launcher_lib.fabric.get_latest_installer_version())

  Return type:

    str

install_fabric(minecraft_version: str, minecraft_directory: str | PathLike, loader_version: str | None = None, callback: CallbackDict | None = None, java: str | PathLike | None = None) → None

  Installs the Fabric modloader.

  Example:

      minecraft_version = "1.20"
      minecraft_directory = minecraft_launcher_lib.utils.get_minecraft_directory()
      minecraft_launcher_lib.fabric.install_fabric(minecraft_version, minecraft_directory)

  Parameters:

    - minecraft_version (str) – A vanilla version that is supported by Fabric

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

    - loader_version (str | None) – The fabric loader version. If not given it will use the latest

    - callback (CallbackDict | None) – The same dict as for `install_minecraft_version()`

    - java (str | PathLike | None) – A Path to a custom Java executable

  Raises:

    - VersionNotFound – The given Minecraft does not exists

    - UnsupportedVersion – The given Minecraft version is not supported by Fabric

  Return type:

    None

View the source code of this module