NBT serialization and deserialization


Keywords
minecraft, typescript, minecraft-launcher, nodejs, electron, nbt, fabric, minecraft-launcher-node, minecraftforge
License
MIT
Install
npm install @xmcl/nbt@3.0.0

Documentation

Minecraft Launcher Core

npm Build Status Convensional Commits Discord

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://corona.studio

Featured Launcher

  • x-minecraft-launcher: An launcher provides general electron api related to minecraft launching (in renderer side), making other developers can easily create new launcher view.
  • PureLauncher: An awesome Minecraft Launcher using React to build beautiful UI.

Getting Started

You can see Active Packages section to quickly find a package you need.

Go our document website to find more detail usage.

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/curseforge Provide Curseforge API npm version packages/curseforge Node/Browser
@xmcl/modrinth Provide Modrinth API npm version packages/modrinth Node/Browser
@xmcl/forge-site-parser Parse forge website npm version packages/forge-site-parser Node/Browser
@xmcl/client Utilities of Minecraft client network. 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/game-data Load level data or servers.dat npm version packages/game-data Node/Browser
@xmcl/resourcepack Parse resource pack npm version packages/resourcepack Node/Browser
@xmcl/task Util package to create task npm version packages/task Node/Browser
@xmcl/system A fs middleware for browser/node npm version packages/system Node/Browser
@xmcl/unzip yauzl unzip wrapper npm version packages/unzip Node
@xmcl/file-transfer High performance undici file download implementation npm version packages/file-transfer Node
@xmcl/nat-api Port mapping with UPnP and NAT-PMP npm version packages/nat-api Node
@xmcl/bytebuffer The bytebuffer module port from bytebuffer.js npm version packages/bytebuffer Node/Browser

Comsuming the Packages with bundlers

The whole project use typescript and esbuild to build. It will build both esm and commonjs version js files. Some modules can be used in browser, and they will have browser version built.

Nowaday, the bundler should all support reading the module field in package.json and use the esm version. If you are using webpack, you can use the resolve.mainFields option to specify which field to use.

From my experience, the esbuild and vite works pretty fine with current package.json.

Contribute

See Contribute.md

Special Thanks

yushijinhun, the author of JMCCC which inspire this library.

Indexyz, helped me a lot on Minecraft launching, authing.

And all of contributors of this repo!