forge

Note

Before using this module, please read this comment from the forge developers:

Please do not automate the download and installation of Forge.
Our efforts are supported by ads from the download page.
If you MUST automate this, please consider supporting the project through https://www.patreon.com/LexManos/

It’s your choice, if you want to respect that and support forge.

forge contains functions for dealing with the Forge modloader

install_forge_version(versionid: str, path: Union[str, PathLike], callback: Optional[CallbackDict] = None, java: Optional[Union[str, PathLike]] = None) None

Installs the given Forge version

Parameters
  • versionid (str) – A Forge Version. You can get a List of Forge versions using list_forge_versions()

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

  • callback (Optional[CallbackDict]) – The same dict as for install_minecraft_version()

  • java (Optional[Union[str, PathLike]]) – A Path to a custom Java executable

Return type

None

Raises a VersionNotFound exception when the given forge version is not found

run_forge_installer(version: str, java: Optional[Union[str, PathLike]] = None) None

Run the forge installer of the given forge version

Parameters
  • version (str) – A Forge Version. You can get a List of Forge versions using list_forge_versions()

  • java (Optional[Union[str, PathLike]]) – A Path to a custom Java executable

Return type

None

list_forge_versions() List[str]

Returns a list of all forge versions

Return type

List[str]

find_forge_version(vanilla_version: str) Optional[str]

Find the latest forge version that is compatible to the given vanilla version

Parameters

vanilla_version (str) – A vanilla Minecraft version

Return type

Optional[str]

is_forge_version_valid(forge_version: str) bool

Checks if a forge version is valid

Parameters

forge_version (str) – A Forge Version

Return type

bool

supports_automatic_install(forge_version: str) bool

Checks if install_forge_version() supports the given forge version

Parameters

forge_version (str) – A Forge Version

Return type

bool

forge_to_installed_version(forge_version: str) str

Returns the Version under which Forge will be installed from the given Forge version.

Parameters

forge_version (str) – A Forge Version

Return type

str

Raises a ValueError if the Version is invalid.

View the source code of this module