dev.polymodloader.api.event.lifecycle
This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.
| Type | Kind | Description |
|---|---|---|
LifecycleEvents | class | Mod lifecycle events: points in the game's start that are not tied to a server or a world. |
ModsInitializedListener | functional interface | Called once on the game's main thread after every mod, of every loader, has been initialised. |
LifecycleEvents
class · Stability PREVIEW · Since 0.1.0-alpha.10
public final class LifecycleEvents
Mod lifecycle events: points in the game's start that are not tied to a server or a world.
Poly Mods' entrypoints run before Minecraft starts. Mods of other loaders (Fabric) initialise where their own loader runs them, inside Minecraft's start (ADR-0020). MODS_INITIALIZED is the point after both, so a Poly Mod that uses another loader's mod can wait for it there.
| Constant or field | Type | Description |
|---|---|---|
MODS_INITIALIZED | EventKey<ModsInitializedListener> | Every mod has been initialised: the Poly Mods' entrypoints and the other loaders' mods' own initialisers (Fabric: main and the side's entrypoint). Fired once per game start, on the game's main thread, at Minecraft's mod initialisation point: after Minecraft's bootstrap (registries exist and are not frozen yet), before the client window or the server starts. The point is the same whether or not mods of other loaders are installed. Register the listener in an entrypoint; a listener registered after the event fired is never called. |
ModsInitializedListener
functional interface · Stability PREVIEW · Since 0.1.0-alpha.10
public interface ModsInitializedListener
Called once on the game's main thread after every mod, of every loader, has been initialised. See LifecycleEvents.MODS_INITIALIZED for when exactly.
Failure: a listener that throws is reported with the mod ID and disabled (POLY-EVENT-001); the game keeps starting.
onModsInitialized()
void onModsInitialized()
Since 0.1.0-alpha.10
Handles the event.