Skip to content

@loontail/minecraft-kit v0.8.14 / targetPaths

Variable: targetPaths

ts
const targetPaths: {
  assetIndex: (root, indexId) => string;
  assetLegacy: (root, virtualPath) => string;
  assetObject: (root, hash) => string;
  assetResource: (root, virtualPath) => string;
  assetVirtual: (root, virtualPath) => string;
  assetsDir: (root) => string;
  assetsLegacyDir: (root) => string;
  forgeInstaller: (root, mavenVersion) => string;
  librariesDir: (root) => string;
  libraryFile: (root, libraryPath) => string;
  loggingConfig: (root, id) => string;
  nativesDir: (root, versionId) => string;
  runtimeJavaExecutable: (directory, component, os, installRoot?) => string;
  runtimeRoot: (directory, component, installRoot?) => string;
  runtimesDir: (root) => string;
  versionDir: (root, versionId) => string;
  versionJar: (root, versionId) => string;
  versionJson: (root, versionId) => string;
  versionsDir: (root) => string;
};

Helpers for the per-target Minecraft directory layout. Use these to derive paths to a specific file (versions/<id>/<id>.jar, assets/objects/<aa>/<sha1>, …) consistently with what the install and verify runners write/expect.

Example

ts
import { targetPaths } from "@loontail/minecraft-kit";

const jar = targetPaths.versionJar(target.directory, target.minecraft.version);
const java = targetPaths.runtimeJavaExecutable(
  target.directory,
  target.runtime.component,
  target.runtime.system.os,
  target.runtime.installRoot,
);

Type declaration

MemberTypeValueDescription
assetIndex(root, indexId) => string...-
assetLegacy(root, virtualPath) => string...-
assetObject(root, hash) => string...-
assetResource(root, virtualPath) => string...-
assetVirtual(root, virtualPath) => string...-
assetsDir(root) => string...-
assetsLegacyDir(root) => string...-
forgeInstaller(root, mavenVersion) => string...-
librariesDir(root) => string...-
libraryFile(root, libraryPath) => string...-
loggingConfig(root, id) => string...-
nativesDir(root, versionId) => string...-
runtimeJavaExecutable(directory, component, os, installRoot?) => string...-
runtimeRoot(directory, component, installRoot?) => string...Path to a runtime component's root directory. Honours installRoot (custom global runtime location) when present; otherwise falls back to <directory>/runtime/<component>.
runtimesDir(root) => string...-
versionDir(root, versionId) => string...-
versionJar(root, versionId) => string...-
versionJson(root, versionId) => string...-
versionsDir(root) => string...-

Source

src/core/paths.ts:39

MIT License