classForge#

class Forge(
version: str,
minecraft: str,
repository: str = 'https://maven.minecraftforge.net',
java_index_url: str = 'https://launchermeta.mojang.com/v1/products/java-runtime/2ec0cc96c44e5a76b9c8b7c39df7210883d12871/all.json',
)#

The Forge loader, for Minecraft 1.13 and later.

repository#

The Maven repository that hosts the installers.

Type:

str

classmethod available(
minecraft: str,
*,
session: Session | None = None,
repository: str | None = None,
promotions_url: str = 'https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json',
) → list[LoaderVersion]#

List Forge’s versions for a Minecraft version, newest first.

The recommended version is the one Forge itself recommends for that Minecraft version, or the newest when it recommends none.

Parameters:
  • minecraft (str) – The Minecraft version.

  • session (Session | None) – The session to use. A temporary one is created if omitted.

  • repository (str | None) – The Maven repository. Defaults to Forge’s own.

  • promotions_url (str) – Where Forge lists its recommended versions.

Returns:

The versions, empty if Forge has none for that Minecraft version, or if it is older than 1.13, whose installers are not supported.

Raises:

NetworkError – The version list could not be fetched.

Return type:

list[LoaderVersion]

classmethod from_version(
version: Version,
minecraft: str,
) → Self | None#

Recognise Forge by the version it passes the game, or its library.

NeoForge for 1.20.1 started as a copy of Forge and passes the same argument, so a version with NeoForge’s libraries is left to NeoForge.

expected_id() → str#

Return the version id that this version’s installer declares.

installer_url() → str#

Return where this version’s installer jar is published.