@lc-studios-mc/lcbuild
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

LCBuild

LCBuild is a Minecraft addon compiler that you can use through commands.

A quick overview of what you can achieve with LCBuild:

  • TypeScript support
  • Centralized project directory
  • One command to compile and copy your packs to Minecraft
  • Automatic manifest.json UUID generation for release builds

Prerequisites

LCBuild only works on Windows 10/11 and requires Node.js version 14 or later.

Make sure TypeScript is installed globally via npm:

npm i typescript -g

Table of contents

Installation

BEFORE YOU INSTALL: please read the prerequisites

First, create a folder somewhere on your drive (C:\ or not does not matter) and open it in terminal.

Second, run the command:

npm init -y
npm i lcbuild typescript --save-dev
npm i @minecraft/server@latest @minecraft/server-ui@latest --save-exact
tsc --init

Installation is complete!

Command

Run npx lcbuild --help to see list of arguments.

However, if you prefer JavaScript, you can also execute build command from script.

Execute from script

Create build.mjs inside your project:

// build.mjs

import * as lcbuild from "lcbuild";

await lcbuild.build({
  srcBpDirPath: /* Path to behavior pack directory */,
  srcRpDirPath: /* Path to resource pack directory */,
  outputDirPath: /* Path to output directory */,
  packVersionSystem: [1, 0, 0],
  packVersionHuman: "1.0.0",
  deletePreviousOutput: true
})

To execute build:

node build.mjs

Manifest templates

Some texts sorrounded by <<<>>> will be converted by LCBuild.

Behavior pack manifest template
{
  "format_version": 2,
  "header": {
    "description": "Pack description",
    "name": "Pack name §eBP §6<<<VERSION_HUMAN>>>§r",
    "uuid": "<<<UUID_HEADER>>>",
    "version": [<<<VERSION_SYSTEM>>>],
    "min_engine_version": [1, 21, 0]
  },
  "modules": [
    {
      "description": "Behavior pack",
      "type": "data",
      "uuid": "<<<UUID_MODULE>>>",
      "version": [<<<VERSION_SYSTEM>>>]
    },
    {
      "description": "Scripts",
      "language": "javascript",
      "type": "script",
      "uuid": "<<<UUID_SCRIPT>>>",
      "version": [<<<VERSION_SYSTEM>>>],
      "entry": "scripts/main.js"
    }
  ],
  "dependencies": [
    {
      // Resource pack
      "uuid": "<<<UUID_RP_HEADER>>>",
      "version": [<<<VERSION_SYSTEM>>>]
    },
    {
      "module_name": "@minecraft/server",
      "version": "1.11.0"
    },
    {
      "module_name": "@minecraft/server-ui",
      "version": "1.1.0"
    }
  ]
}
Resource pack manifest template
{
  "format_version": 2,
  "header": {
    "description": "Pack description",
    "name": "Pack name §eRP §6<<<VERSION_HUMAN>>>§r",
    "uuid": "<<<UUID_HEADER>>>",
    "version": [<<<VERSION_SYSTEM>>>],
    "min_engine_version": [1, 21, 0]
  },
  "modules": [
    {
      "description": "Resource pack",
      "type": "resources",
      "uuid": "<<<UUID_MODULE>>>",
      "version": [<<<VERSION_SYSTEM>>>]
    }
  ]
}

Contributing

LCBuild is an open-source project.

See CONTRIBUTING.md for more details.

License

Licensed under MIT

Package Sidebar

Install

npm i @lc-studios-mc/lcbuild

Weekly Downloads

186

Version

2.1.0

License

MIT

Unpacked Size

28.7 kB

Total Files

7

Last publish

Collaborators

  • lc45