Appearance
@loontail/minecraft-kit v0.8.14 / asMinecraftVersionId
Function: asMinecraftVersionId()
ts
function asMinecraftVersionId(raw): MinecraftVersionIdValidate raw as a Minecraft version id and brand it as MinecraftVersionId. Throws MinecraftKitError(INVALID_INPUT) when the input is empty after trimming. Version ids span vanilla ("1.20.1"), snapshot ("24w14a"), and loader-flavoured shapes ("fabric-loader-0.14.21-1.20.1", "1.20.1-forge-47.2.0"), so the constructor only enforces non-emptiness — the resolver decides whether the id actually corresponds to a published version.
Parameters
| Parameter | Type |
|---|---|
raw | string |
Returns
Example
ts
import { asMinecraftVersionId } from "@loontail/minecraft-kit";
const id = asMinecraftVersionId("1.20.1");
await kit.versions.minecraft.resolve({ version: id });