Troubleshooting & FAQ
Common Issues
mbler: command not found
Mbler is not installed or not in your PATH.
Solution:
npm install -g mblerIf you used pnpm, ensure the pnpm global bin directory is in your PATH:
pnpm setup
# then restart your terminalBuild fails with Cannot find module '@minecraft/server'
The @minecraft/server module is external and should not be installed locally — it is provided by the Minecraft Bedrock engine at runtime. Mbler automatically marks it as external during bundling.
Solution: Make sure mbler.config.js does not list @minecraft/server or @minecraft/server-ui in build.rollupExternal (they are already handled internally).
BUILD_MODULE=release not set
The .mcaddon zip file is only generated when BUILD_MODULE=release is set in the environment. The mbler build command does not create the zip by default — use mbler publish instead, which sets this flag automatically.
To generate a release zip manually:
BUILD_MODULE=release mbler buildDeterministic UUID has changed
Mbler generates UUIDs deterministically from the project name, type, and salt. If you rename your project or change the name in package.json, the UUIDs will change, which will break existing worlds.
Solution: Keep the name field stable after releasing your addon.
Watch mode not detecting file changes
On some systems (e.g., WSL, Docker, network file systems), chokidar may not detect changes reliably.
Solution:
- Make sure you are not using a network drive
- Try running
mbler buildmanually instead - On WSL, store your project on the Linux filesystem (not
/mnt/c/)
Language server not starting in VS Code
Solution:
- Open the command palette (
Ctrl+Shift+P) - Run
MCX: Restart Language Server - If that fails, check that
@mbler/mcx-serveris installed:bashnpm install @mbler/mcx-server --save-dev
mcx-tsc exits with no output
The MCX TypeScript compiler (mcx-tsc) uses Volar under the hood. If it produces no output, there may be a TypeScript configuration issue.
Solution: Check that tsconfig.json exists in your project root and that it includes your .mcx files.
FAQ
Can I use plain JavaScript instead of TypeScript?
Yes. Set script.lang: "js" in mbler.config.js.
Can I use both JS and MCX files?
Yes. MCX files (.mcx) are compiled to JavaScript by the @mbler/mcx-core Rolldown plugin. You can mix .ts, .js, and .mcx files freely.
How do I test my addon without publishing?
Set outdir in mbler.config.js to point directly to your Minecraft Bedrock behavior/resource pack folders:
outdir: {
behavior: "/path/to/com.mojang/development_behavior_packs/my-addon",
resources: "/path/to/com.mojang/development_resource_packs/my-addon",
}Then run mbler build — the outputs go directly to the game directory.
Where is the log file?
mbler log point
# Prints: /home/user/.cache/mbler/latest.logHow do I change the CLI language?
mbler lang # show current language
mbler lang zh # switch to Chinese
mbler lang en # switch to EnglishWhat Minecraft versions are supported?
Mbler supports any Minecraft Bedrock version that uses the Script API (v1.19.50+). Set mcVersion in mbler.config.js to your target version.
How do I update mbler?
npm update -g mblerCheck the current version:
mbler versionCan I use mbler with CI/CD pipelines?
Yes. The login, publish, and unpublish commands are designed for automation. Store your MNX token securely as a CI secret and use:
mbler login $MNX_TOKEN
mbler publish -tag latestHow Mbler Resolves SAPI Versions
When you set mcVersion: "1.21.100" in mbler.config.js, Mbler needs to find the correct @minecraft/server and @minecraft/server-ui npm package versions that ship with that Minecraft version. This resolution happens in src/build/sapi.ts.
The Problem
Minecraft Bedrock's Script API (@minecraft/server) publishes many versions to npm, each embedding the target Minecraft version in its version string. For example:
2.1.0-beta.1.21.100-stable → Minecraft 1.21.100
2.0.0-beta.1.21.60-stable → Minecraft 1.21.60
2.5.0-beta.1.21.120-preview → Minecraft 1.21.120 (preview/beta)The version string format is: <sapi-version>-<channel>.<embedded-mc-version>-<stability>.
Resolution Algorithm
Fetch npm registry: Mbler fetches all versions of
@minecraft/serverand@minecraft/server-uifromhttps://registry.npmjs.com.Extract MC version: For each npm version, it extracts the embedded Minecraft version using the regex:
/-(?:rc|beta)(?:\.[^-.]+)*?\.((?:\d+\.){2}\d+)/This matches patterns like
beta.1.21.100and captures1.21.100.Classify releases: Each entry is classified as either:
- Formal (stable) — version string contains
-stable - Beta (preview) — everything else (release candidates, previews, etc.)
- Formal (stable) — version string contains
Build a version map: The result is a lookup table mapping each Minecraft version to its latest formal and beta SAPI versions:
json{ "server": { "1.21.60": { "formal": "2.0.0-beta.1.21.60-stable", "beta": "" }, "1.21.100": { "formal": "2.1.0-beta.1.21.100-stable", "beta": "" }, "1.21.120": { "formal": "", "beta": "2.5.0-beta.1.21.120-preview" } } }Cache: The map is saved to
~/.mbler/_sapi_version.jsonfor offline reuse. Callrefresh()to update.Lookup (
generateVersion):- Try exact match on
mcVersionfirst - If no exact match, find the closest lower version (e.g., if you request
1.21.110and only1.21.100exists, it falls back to1.21.100) - If no lower version exists, use the earliest available version
- Returns the formal (stable) version by default, or beta if
isBetais set - Falls back to the other channel if the requested channel is empty
- Try exact match on
Version shortening (
evalVersion): The returned version is shortened formanifest.jsondependencies. For example:"2.1.0-beta.1.21.100-stable" → "2.1.0-beta"Only the first two segments of the prerelease tag are kept.
Debugging SAPI Resolution
To see which version Mbler resolved for your project, run:
BUILD_MODULE=release mbler buildThe resolved version appears in the generated manifest.json under dependencies. You can also check the cache file directly:
cat ~/.mbler/_sapi_version.json