Skip to content

@loontail/minecraft-kit v0.8.14 / MinecraftVersionId

Type alias: MinecraftVersionId

ts
type MinecraftVersionId: string & {
  __brand: "MinecraftVersionId";
};

Branded Minecraft version id (e.g. "1.20.1", "1.20.1-forge-47.2.0", "fabric-loader-0.14.21-1.20.1"). Construct via asMinecraftVersionId (exported from the package root) — the brand prevents accidentally passing a player UUID, an asset-index id, or another opaque string where the install/launch pipeline expects a Minecraft version id.

The resolver brands at the Mojang-manifest boundary; reach for asMinecraftVersionId when reading a saved version id from disk or when the host environment supplies one.

Example

ts
import { asMinecraftVersionId, type MinecraftVersionId } from "@loontail/minecraft-kit";

const id: MinecraftVersionId = asMinecraftVersionId("1.20.1");
const resolved = await kit.versions.minecraft.resolve({ version: id });

Type declaration

MemberType
__brand"MinecraftVersionId"

Source

src/types/minecraft.ts:50

MIT License