Skip to content

@loontail/minecraft-kit v0.8.14 / LaunchSession

Type alias: LaunchSession

ts
type LaunchSession: {
  exited: Promise<LaunchExit>;
  pid: number;
  abort: void;
};

Live handle for a running game process.

Example

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

const session: LaunchSession = kit.launch.run(composition);
console.log("game pid:", session.pid);
process.once("SIGINT", () => session.abort("user-interrupt"));
const exit = await session.exited;

Type declaration

MemberTypeDescription
exitedPromise<LaunchExit>Resolves with the exit code/signal when the process terminates.
pidnumberOperating-system process id.
abortvoidBest-effort cancel — sends SIGTERM, then SIGKILL after the grace period.

Source

src/types/launch.ts:128

MIT License