/minecraft-launcher-core-node

Various useful packages related to Minecraft launcher

Primary LanguageTypeScriptMIT LicenseMIT

Minecraft Launcher Core

npm Build Status Convensional Commits lerna

Provide several useful functions to build a Minecraft Launcher.

Most packages are targeting the Electron environment. Feel free to report issues related to it.

Looking for C# Launcher Core?

Introduce the awesome .net framework launcher core, ProjBobcat.

It's the next generation Minecraft launcher core written in C# providing the freest, fastest and the most complete experience. https://craftmine.fun

Featured Launcher

  • PureLauncher: An awesome Minecraft Launcher using React to build beautiful UI.

Installation & Usage

This repo maintaining multiple mini packages for specific functions.

If you use electron to write a minimum launcher, you can install @xmcl/core which only has such functions:

  • Parse existed Minecraft version
  • Launch the game

If you have bigger ambition on your launcher, you want it be able to download/install Minecraft, then you can have @xmcl/installer, which contains the functions of:

  • Get the version information of Minecraft/Forge/Liteloader/Fabric
  • Install Minecraft/Forge/Liteloader/Fabric to the game folder

If you still not satisfied, as you want even provide the function to parse existed resource pack and mods under game folder, then you will have @xmcl/mod-parser and @xmcl/resourcepack modules, which contain such functions:

  • Parse Forge/Liteloader/Fabric mods metadata
  • Parse resource pack metadata

There are more packages for advantage usages, and you can check out the getting started section to navigate.

Bundle & Treeshaking

The module built with ES5 module option by typescript. To use treeshake, please make sure your bundle system support esm import/export.

Some bundler like webpack, rollup support treeshake by default. Just make sure you dont do something like import * as SomeNamespace from ..., which will bundle the whole package. (But import { xxx } from 'xxx' will still work)

CommonJS

If you don't have a bundler to transform the package, you can still use it in cjs. The webpack will pick the "main" field in package.json which is pointing to the cjs version.

It means you don't need to do anything in extra ideally.

Electron Version

Recommend to use the latest electron, so you don't need to setup babel with webpack 4.

Getting Started

Go Getting Started page.

Or you can read the full document.

Active Packages

Name Usage Version Location Runtime Envrionment
@xmcl/core Launch Minecraft npm version packages/core Node
@xmcl/installer Install Minecraft npm version packages/installer Node
@xmcl/user User Authentication and skin npm version packages/user Node/Browser
@xmcl/mod-parser Parse forge/liteloader/fabric mod npm version packages/mod-parser Node/Browser
@xmcl/forge-site-parser Parse forge website npm version packages/forge-site-parser Node/Browser
@xmcl/client Ping Minecraft Server npm version packages/client Node
@xmcl/model Display player/block model npm version packages/model Browser
@xmcl/gamesetting Parse game setting npm version packages/gamesetting Node/Browser
@xmcl/nbt Parse NBT npm version packages/nbt Node/Browser
@xmcl/text-component Parse and render Minecraft Text npm version packages/text-component Node/Browser
@xmcl/resource-manager Load model from resource pack npm version packages/resource-manager Node/Browser
@xmcl/world Load save metadata npm version packages/world Node/Browser
@xmcl/resourcepack Parse resource pack npm version packages/resourcepack Node/Browser
@xmcl/server-info Parse servers.dat npm version packages/server-info Node/Browser
@xmcl/task Util package to create task npm version packages/task Node
@xmcl/system A fs middleware for browser/node npm version packages/system Node/Browser
@xmcl/unzip yauzl unzip wrapper npm version packages/unzip Node

Contribute

See Contribute.md

Credit

lukechu10 helped me to generate the document from typescript.

HoldYourWaffle provided great suggestions to repo.

Yu Xuanchi provided some idea about NBT module.

Haowei Wen, the author of JMCCC, Authlib Injector, and Indexyz, helped me a lot on Minecraft launching, authing.