Workspace Layout

bb init writes a project that builds on the first run. This page explains each file and folder.

my-addon/
  config.json                 project config, read by every command
  package.json                scripts plus @minecraft/server dep
  tsconfig.json               strict, noEmit, includes src/
  src/main.ts                 script entry, bundled by esbuild
  packs/BP/                   behavior pack sources
  packs/RP/                   resource pack sources
  dist/                       build output, gitignored

config.json

Every command except init, version, and manifest loads this file. It holds the project name, version, pack paths, entry file, output folder, and deploy target. Full schema: Config Schema.

src/

The entry file defaults to src/main.ts. Use --js at create time for src/main.js instead. bb build bundles the entry into dist/packs/BP/scripts/main.js with @minecraft/server packages kept external.

packs/

packs/BP/ holds behavior files: entities, items, blocks, recipes, loot, spawn rules, functions. packs/RP/ holds resource files: textures, models, sounds, UI. Run bb folders for an interactive picker that creates the canonical subfolders, so no guessing of singular versus plural names.

dist/

Build output only. bb build writes dist/packs/BP/ and dist/packs/RP/. bb clean removes dist/ plus the build cache. Never edit files in dist/. The next build overwrites them.