Packaging and Archive Formats
When distributing add-ons or worlds, you compress the development folders into standard ZIP archives and rename their extensions. Minecraft Bedrock registers these extensions with the operating system so that double-clicking a file launches the game and imports the content automatically into the internal storage folders.
When creating these archives, zip the contents of your pack folder directly so that manifest.json sits at the root of the archive, rather than zipping the parent folder itself. If manifest.json is buried inside a subfolder within the archive, the game importer will fail to recognize the pack.
| Extension | Contents | Import Behavior |
|---|---|---|
| .mcpack | A single Behavior Pack, Resource Pack, or Skin Pack. | Extracts into the corresponding development or internal pack folder. |
| .mcaddon | Multiple .mcpack files or pack folders bundled together. | Imports both Behavior and Resource packs in one step. |
| .mcworld | A complete world save folder, optionally with embedded packs. | Imports into the local minecraftWorlds directory as a playable level. |
| .mctemplate | A world save plus a world_template manifest. | Adds an entry to the Create New World templates list. |
| .mcstructure | A binary NBT structure exported via a Structure Block. | Placed inside BP/structures/ to be loaded by structure blocks, features, or commands. |
Data and Configuration Files (.json)
Almost all declarative definitions in both Behavior Packs (BP) and Resource Packs (RP) use the .json extension. This includes entities, blocks, items, recipes, loot tables, spawn rules, client entity definitions, models, particles, and UI screens. The engine parses these files during pack loading and validates them against internal schemas tied to the format_version string.
While standard JSON strictly forbids comments, the Bedrock engine's parser supports JSON with Comments (JSONC) in most definition files, allowing single-line (//) and multi-line (/* */) comments. However, trailing commas after the last element in an object or array will cause a syntax error in newer format versions. Certain files in the RP/models/entity/ directory frequently use the double extension .geo.json by convention, though the engine only requires that they end in .json.
{
"format_version": "1.20.50",
"minecraft:item": {
"description": {
"identifier": "example:copper_wrench",
"menu_category": {
"category": "equipment"
}
},
"components": {
"minecraft:max_stack_size": 1,
"minecraft:hand_equipped": true,
"minecraft:icon": {
"texture": "copper_wrench"
}
}
}
}Executable Logic: Functions and Scripts
Behavior packs support two distinct types of executable text files: command functions (.mcfunction) and Script API code (.js). Files ending in .mcfunction live in the BP/functions/ directory and contain plain-text lists of slash commands, executed sequentially from top to bottom within a single game tick. Commands inside a function file are written without the leading forward slash, and lines starting with a hash symbol (#) are ignored as comments.
JavaScript files (.js) belong in the BP/scripts/ directory and run inside the QuickJS engine when the manifest declares a script module. If you author your scripts in TypeScript (.ts), you must compile them down to standard ES2020 JavaScript (.js) before the game can load them; Bedrock cannot execute TypeScript files directly.
| Extension | Location | Format Rules |
|---|---|---|
| .mcfunction | BP/functions/ | UTF-8 without BOM. One command per line, no leading slash, # for comments. |
| .js | BP/scripts/ | ES6 module syntax. Entry file must match the entry path in manifest.json. |
| .json | BP/functions/tick.json | Special JSON array listing .mcfunction paths to run every game tick. |
import { world } from "@minecraft/server";
world.afterEvents.playerSpawn.subscribe((event) => {
if (event.initialSpawn) {
event.player.sendMessage("Welcome to the server!");
}
});Visual Assets: Textures and Shaders
All 2D artwork, block textures, item icons, entity skins, and custom UI elements reside in the RP/textures/ directory. Standard raster images use the .png format, while high-end Physically Based Rendering (PBR) and deferred rendering packs can also utilize .tga (Targa) files when distinct alpha channel handling is required without PNG compression artifacts.
When references to textures are made inside JSON files such as terrain_texture.json or item_texture.json, you always omit the file extension (.png or .tga). This allows the engine to dynamically select between standard textures or Texture Set (.texture_set.json) definitions if Vivid Visuals or ray tracing is active.
| Extension | Location | Usage and Constraints |
|---|---|---|
| .png | RP/textures/ | 8-bit per channel RGBA recommended. Block and item textures should maintain power-of-two dimensions (16x16, 32x32). |
| .tga | RP/textures/ | Uncompressed or RLE-compressed Targa images, primarily used in MER (Metalness, Emissive, Roughness) maps. |
| .texture_set.json | RP/textures/ | Binds a base color texture to heightmap, normal, and MER textures for PBR rendering. |
Audio Assets (.ogg, .fsb, .wav)
Sound effects and music tracks belong in the RP/sounds/ folder and are mapped to sound events via RP/sounds/sound_definitions.json. Just like texture references, paths inside sound_definitions.json omit the file extension. Ogg Vorbis (.ogg) is the standard, recommended format for all custom audio because it balances small file sizes with reliable cross-platform decoding.
The engine uses the FMOD audio system under the hood. While .wav files and FMOD Sound Banks (.fsb) are technically supported by the audio engine, .wav files drastically inflate pack size and must be formatted strictly as 16-bit PCM to play cleanly. Mono audio files are required for any 3D positional sound (like entity noises or block breaks); stereo files will bypass positional attenuation and play at constant volume regardless of the player's distance.
Localization and Text (.lang)
All human-readable text in an add-on—such as item names, entity names, custom death messages, and UI labels—is stored in .lang files inside the RP/texts/ directory (and inside BP/texts/ exclusively for translating pack manifest names and descriptions). Each file is named after a specific locale code, such as en_US.lang or ja_JP.lang, and listed inside RP/texts/languages.json.
A .lang file uses a simple key=value format per line. Comments begin with two hashes (##) and can be placed on their own line or after a tab character on a translation line. These files must be encoded in UTF-8 without a Byte Order Mark (BOM).
## Items
item.example:copper_wrench.name=Copper Wrench
## Entities
entity.example:Automaton.name=Copper Automaton ## Spawn egg and nametag textWhich versions this applies to
Applies to all modern Minecraft Bedrock versions (1.16.0 through 1.21+). No experimental toggles are required for standard file parsing, though specific Script API modules in .js files may require Beta APIs depending on the module version.
When it does not work
| What you see | Why | The fix |
|---|---|---|
| Failed to import pack / Not a valid zip archive | You compressed the parent folder instead of its contents when creating the .mcpack, or you used .rar / .7z compression instead of standard .zip before renaming the extension. | Select manifest.json and its sibling folders directly, compress them using standard ZIP format, and rename the resulting .zip file to .mcpack. |
| First line of .lang or .mcfunction file is completely ignored by the game | The text editor saved the file with a UTF-8 with BOM (Byte Order Mark) encoding. The invisible BOM bytes corrupt the first translation key or command on line 1. | Change the file encoding in your code editor to standard UTF-8 (without BOM) and resave the file. |
| Custom sound plays everywhere in the world at full volume instead of fading with distance | The .ogg or .wav file was exported with two audio channels (Stereo) instead of a single channel (Mono). FMOD only applies 3D spatial attenuation to mono sound files. | Re-export the audio file in an audio editor (such as Audacity) mixed down to a single Mono channel. |
| JSON parse error: unexpected token or trailing comma in Content Log | A .json file has a comma after the very last property of an object or array, or uses unescaped control characters inside a string. | Remove the trailing comma before the closing } or ] bracket and validate the file with a JSON linter. |
Reference, straight from the game files
Read out of the game itself, so the ids match the version you are building for.
