libminecraft
Library for interacting with the Minecraft assets API, Forge website and for launching Minecraft.
Usage
Install from npm:
npm install --save libminecraft
And import:
;
Features
- Download and install Minecraft
; // all functions are exported in index.ts; // may be useful in some cases, creates id-version object ;; // install using the meta we selectedawait Installfolder, meta, /** optional */console.logprogress;// typescript types should give you all the info you need about progress
- Launch Minecraft
; // assets, versions, etc; // saves, logs, etc; // load version back up from disk // we can now launchawait Launch};
- Install Forge Modloader
; // be sure to check if Forge supports the version; // likewise we can get an index, if needed // install the Forge version, just install the first one we know of;await InstallForgeVersionfolder, page.versions, /** optional */console.logprogress;// progress update is likewise available
- Authenticate through Yggdrasil
// simply pass credentials and an account object will be returned; // account can be passed to Launch// you should probably save the account object instead of credentials// then later you can refresh it like so: ;// newAccount has a new accessToken hence you should overwrite the old account with this