Making a custom block with an add-on
The block JSON in the behavior pack (BP) sets what the block is and how it behaves, and the resource pack (RP) gives its textures, model and name. The format_version of the block file unlocks block features. The manifest min_engine_version does not decide block features. Blocks have no rule IDs like JSON UI, so this guide points to topic page sections and MCPE numbers as evidence.
When to use it
| What you want | Method in this guide | When it does not fit |
|---|---|---|
| Add a new block (texture, shape, light, mining, shape by state) | BP blocks/*.json + RP textures and geometry | - |
| A block that acts when used or stepped on | Script custom components (blockComponentRegistry) | Block events (events, minecraft:on_placed) were removed |
| Store items inside a block | container of minecraft:block_entity | Needs the Upcoming Creator Features experiment |
| Draw the stored items on the block like an item frame or shelf | Not possible with JSON. minecraft:block_entity has no field that picks a renderer {code (binary)} | An invisible entity inside the block holds the item. On a custom server, the shelf archetype (Sending custom blocks and items from a server) |
| A model larger than about 30px, or poly_mesh | Block geometry is cubes only, up to about 30px per axis | Several blocks, a multi-block, or an entity |
| Change the JSON, model, loot or behavior of a vanilla block | Add-ons cannot change it | Remove the drops and create new ones with a script |
| Falling blocks, animated models, custom fluids, sign text | Not possible as a block | An entity or a script |
| Define the block in server code without a BP | This guide is not enough | Sending custom blocks and items from a server |
Minimal example
A block that flips a boolean state each time it is used, with a permutation bound to that state that swaps the texture. It is copied as is from the example in section 3 of Blocks; each use changed the state false, true, false and the texture followed {measured} (2026-11-27 Windows 1.26.65).
BP/manifest.json
BP/blocks/toggle_block.json
BP/scripts/main.js
RP/manifest.json
RP/textures/terrain_texture.json
RP/textures/blocks/toggle_off.png
RP/textures/blocks/toggle_on.png
RP/texts/en_US.lang
The UUIDs are placeholders; generate new ones. Make the two PNGs yourself at 16x16.
BP/manifest.json: a data and a script module, a dependency on the RP UUID (adds the RP automatically), and a dependency on @minecraft/server.
{
"format_version": 2,
"header": {
"name": "Toggle Block BP",
"description": "Toggle block behavior pack",
"uuid": "00000000-0000-4000-8000-0000000000a1",
"version": [1, 0, 0],
"min_engine_version": [1, 26, 30]
},
"modules": [
{ "type": "data", "uuid": "00000000-0000-4000-8000-0000000000a2", "version": [1, 0, 0] },
{
"type": "script",
"language": "javascript",
"uuid": "00000000-0000-4000-8000-0000000000a3",
"version": [1, 0, 0],
"entry": "scripts/main.js"
}
],
"dependencies": [
{ "uuid": "00000000-0000-4000-8000-0000000000b1", "version": [1, 0, 0] },
{ "module_name": "@minecraft/server", "version": "2.7.0" }
]
}
RP/manifest.json:
{
"format_version": 2,
"header": {
"name": "Toggle Block RP",
"description": "Toggle block resource pack",
"uuid": "00000000-0000-4000-8000-0000000000b1",
"version": [1, 0, 0],
"min_engine_version": [1, 26, 30]
},
"modules": [
{ "type": "resources", "uuid": "00000000-0000-4000-8000-0000000000b2", "version": [1, 0, 0] }
]
}
BP/blocks/toggle_block.json: the state wiki:on, the vanilla full_block geometry, the custom component wiki:toggle, and one permutation that swaps the texture when the state is true.
{
"format_version": "1.26.30",
"minecraft:block": {
"description": {
"identifier": "wiki:toggle_block",
"menu_category": { "category": "construction" },
"states": { "wiki:on": [false, true] }
},
"components": {
"minecraft:geometry": { "identifier": "minecraft:geometry.full_block" },
"minecraft:material_instances": {
"*": { "texture": "toggle_off", "render_method": "opaque" }
},
"wiki:toggle": {}
},
"permutations": [
{
"condition": "q.block_state('wiki:on')",
"components": {
"minecraft:material_instances": {
"*": { "texture": "toggle_on", "render_method": "opaque" }
}
}
}
]
}
}
RP/textures/terrain_texture.json: the keys are the texture values of material_instances. Paths have no extension.
{
"resource_pack_name": "wiki",
"texture_name": "atlas.terrain",
"texture_data": {
"toggle_off": { "textures": "textures/blocks/toggle_off" },
"toggle_on": { "textures": "textures/blocks/toggle_on" }
}
}
RP/texts/en_US.lang:
tile.wiki:toggle_block.name=Toggle Block
BP/scripts/main.js: register the component in startup. Read the state with block.permutation.getState (Block has no getState).
import { system } from "@minecraft/server";
system.beforeEvents.startup.subscribe(({ blockComponentRegistry }) => {
blockComponentRegistry.registerCustomComponent("wiki:toggle", {
onPlayerInteract({ block }) {
const isOn = block.permutation.getState("wiki:on");
block.setPermutation(block.permutation.withState("wiki:on", !isOn));
},
});
});
- No
blocks.json. For a block with geometry, onlysoundis valid inblocks.json; atexturesentry gives the errortrying to override the Geometry component with blocks.json settings. wiki:togglestays only in the basecomponents, and the permutation holds onlymaterial_instances(MCPE-234714, table below).- With
onPlayerInteract, ordinary use and placement against the block are blocked; you must sneak to place a block next to it.
Switching to a custom geometry
To change the shape, put a geometry in RP models/blocks/*.geo.json and point to its identifier from the BP. The half-height block below combines the block geometry form of the measurement add-on addons/json-ui-claims (format_version 1.12.0, models/blocks/, per-face UV, "minecraft:geometry": "geometry.<name>") with the box values of section 7 of Blocks. No run of this combination is recorded.
RP/models/blocks/half_block.geo.json: each face uses the area of the 16x16 texture from (0,0) the size of the face. UV maps to the texture as a ratio of texture_width/texture_height.
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": { "identifier": "geometry.half_block", "texture_width": 16, "texture_height": 16 },
"bones": [
{
"name": "root",
"pivot": [ 0, 0, 0 ],
"cubes": [
{
"origin": [ -8, 0, -8 ], "size": [ 16, 8, 16 ],
"uv": {
"north": { "uv": [ 0, 0 ], "uv_size": [ 16, 8 ] },
"south": { "uv": [ 0, 0 ], "uv_size": [ 16, 8 ] },
"east": { "uv": [ 0, 0 ], "uv_size": [ 16, 8 ] },
"west": { "uv": [ 0, 0 ], "uv_size": [ 16, 8 ] },
"up": { "uv": [ 0, 0 ], "uv_size": [ 16, 16 ] },
"down": { "uv": [ 0, 0 ], "uv_size": [ 16, 16 ] }
}
}
]
}
]
}
]
}
In the BP block components, change the geometry and match the boxes to the shape.
{
"minecraft:geometry": "geometry.half_block",
"minecraft:collision_box": { "origin": [ -8, 0, -8 ], "size": [ 16, 8, 16 ] },
"minecraft:selection_box": { "origin": [ -8, 0, -8 ], "size": [ 16, 8, 16 ] }
}
Must match
- Write the block file
format_versionin game version form like1.26.30."26.30"does not work, and a version newer than the game givesUnexpected version for the loaded data{single report}. - Block
format_versionneeded per feature: custom components 1.21.90 or later,connection_ruleand the new traits 1.26.0 or later, theminecraft:tagsarray 1.26.20 or later. Only the value in the block file matters. - Structure:
identifier,menu_category,states,traitsinsidedescription.permutationsdirectly underminecraft:block. Every component insidecomponents. A component outsidecomponentsis ignored without an error. - Give identifiers a namespace and no capital letters. State names need a namespace too (
wiki:on). menu_category.categoryis lowercase (construction). Capitals or the typomenu_catagoryhide the block from creative without a message. Use"none"to hide it.- One state holds at most 16 values. Every combination of states becomes a permutation.
- A permutation
conditionreads only the block's own states (q.block_state('ns:name')). Do not repeat the same condition. - Trait states (
minecraft:cardinal_direction,minecraft:block_faceand others) can be read only after the trait is turned on intraits. Otherwise you getmaking use of non-registered block state. - A block with
minecraft:geometryneedsminecraft:material_instances. A format 1.26.20 block withmaterial_instancesand nogeometryis not registered and logs nothing{measured}. material_instanceskeys are face names (up,down,north,south,east,west), bone or Blockbench face names, and the default*. Fields aretexture(nottextures),render_method,face_dimming,ambient_occlusion,tint_method,isotropic.- The
texturevalue is atexture_datakey ofRP/textures/terrain_texture.json(not a path). Vanilla textures must be defined in this file too. - Instances of one block cannot mix
render_methodvalues (MaterialInstances can't mix and match). - Write vanilla geometry with the
minecraft:prefix (minecraft:geometry.full_block,minecraft:geometry.cross). - A custom model is cubes only, up to about 30px per axis including rotation (14px outside the unit cell). The size is checked before transformation (MCPE-236317).
- Give every face an explicit UV. Faces without a UV are dropped and become holes.
- Use at most one decimal place in coordinates. A second decimal place makes gaps and render errors.
minecraft:collision_boxis one box or an array of at most 16{measured}. The area the boxes cover is x and z from -8 to 8 and y from 0 to 24 inoriginterms{measured}.minecraft:selection_boxtakes only oneorigin/sizeobject, with a height limit of 16. An array ormin/maxis rejected and the block is not registered{measured}.- To turn a box off, use
false.collision_box: []is a full collision, not no collision. - Tags: format 1.26.20 or later uses the
"minecraft:tags": ["ns:tag"]array, earlier formats use"tag:ns:name": {}components. The wrong form makes the block registration fail{measured}. - Put
bone_visibilityinside theminecraft:geometryobject; from 1.26.20 write the values as"true"/"false"strings or Molang (MCPE-238524). - From 1.26.20
ambient_occlusionis a number (0 to 10). A boolean gives a misleadinginvalid stringerror. - Write a custom component directly in
componentsas"ns:id": {}and register it withblockComponentRegistry.registerCustomComponentinsystem.beforeEvents.startup. The BP manifest needs ascriptmodule and@minecraft/server2.0.0 or later, and the entry file imports the component file. - If a permutation holds even one custom component, the base custom components are ignored (MCPE-234714). Then write every custom component again in every permutation.
- Custom component parameters nest at most 2 deep.
- The block name lang key is
tile.<ns>:<id>.name, in RPtexts/en_US.lang.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
/give gives a syntax error and the log is empty | material_instances without minecraft:geometry | Add minecraft:geometry.full_block or a custom geometry {measured} |
| The block is missing from creative | menu_category is outside description, or the value has capitals or a typo | Put a lowercase category inside description |
| The texture is a purple and black grid | The texture value differs from the terrain_texture.json key, the path has .png, or the JSON is a BOM file | Match the key, drop the extension, save as UTF-8 without BOM |
trying to override the Geometry component with blocks.json settings | A geometry block has blocks.json textures | Keep only sound in blocks.json |
The custom blocks of a subchunk all vanish, with A block must have baked material data in order to tessellate | One block's geometry is too large or invalid | Shrink the model to about 30px and use cubes only |
Total length of parts for schematic ... greater than 1 + 14/16ths | The model goes more than 14px outside the unit cell | Split the model, or use a multi-block or an entity |
is not included within the unit cube | poly_mesh or a locator | Use cubes |
| Faces have holes in game but look fine in Blockbench | Box UV only, no per-face UV | Use per-face uv and uv_size, and delete faces that should not show |
| Transparent pixels look black | opaque with transparent pixels | Pick alpha_test, alpha_test_single_sided or blend |
MaterialInstances can't mix and match | Instances have different render_method values | Use one render method per block |
collision_box: too many input elements, expected no more than 16 | 17 or more boxes | Use 16 or fewer {measured} |
Block type ... not found after changing box values | A box is outside the allowed area, or selection_box is an array | Keep collision within height 24 and selection within height 16, and write the selection box as one object {measured} |
child 'x:y' not valid here or component found in input but not present in Schema | The custom component is not registered (script error, registered on itemComponentRegistry, old format_version, no script module in the manifest) | Meet the registration conditions. The error goes away only when the script loads |
Block custom component 'x' is not being used by a block | format_version too low or the component in the wrong place | Block format 1.21.90 or later, inside components |
| A custom component is not called in some states | Another custom component in a permutation made the base one ignored (MCPE-234714) | Write every custom component in every permutation |
Identifier must have a namespace / Failed to create Block State Description | The state name has no namespace | Write it as ns:name |
making use of non-registered block state | A trait state was read without turning the trait on | Add it to enabled_states in traits |
| The block stops registering after adding tags | The tag form does not match the block format_version | minecraft:tags array for 1.26.20 or later, tag: components below that {measured} |
TypeError: not a function (block.getState) | Block has no getState | Use block.permutation.getState {measured} |
| Changes to the script or block JSON do not show | Registration happens only in startup, and /reload does not rerun startup | Leave the world and enter again |
| You cannot place a block next to the block | onPlayerInteract blocks ordinary use and placement | Sneak to place, or use world.beforeEvents.playerInteractWithBlock to avoid blocking |
The last log line is Unexpected version for the loaded data | It follows an earlier real error | Scroll up to the first error for that block |
Version conditions
- 1.26.6x release: block features are unlocked by the block file
format_version. A 1.21.90 block got the new traits working just by raising the number to 1.26.0. - From format 1.26.20 a new parser is used:
ambient_occlusionis a number,bone_visibilityvalues are strings, tags are theminecraft:tagsarray. Error messages carry no location. - From format 1.26.60,
collision_boxwritten withmin/maxneeds Upcoming Creator Features.origin/sizeworks without the experiment{measured}. dynamic_propertiesofminecraft:block_entityis not experimental from 26.50.containerneeds Upcoming Creator Features and format 1.26.20 or later, and in a world made without the toggle the block disappears from creative.- Vertical and horizontal multi-blocks (
minecraft:multi_block) are stable in 26.50. - In the 27.0.20 preview,
onPlayerInteractandbeforeOnPlayerPlaceare called only in the permutations that hold that component (MCPE-225746 fixed). The wiki has no fact that changes this task in the 26.70 preview.
How to check
- Put the BP in
development_behavior_packsand the RP indevelopment_resource_packs, and turn on both packs in the world settings. When the BP manifest depends on the RP UUID, the RP is added with it. - Turn on the Content Log GUI under Creator in the settings and enter the world.
- Find the block in its creative category or use
/give @s wiki:toggle_block. If/givegives a syntax error, the block was not registered. - Place and use the block. For the example, each use switches the texture between
toggle_offandtoggle_on. - If there are errors, read the content log from the top. For a block error, the first line says the block is invalid, the second names the component, the third gives the real reason, and the fourth is data that does not fit the
format_version. - If you changed only geometry or textures, use
/reload all. If you changed the block JSON, component registration or script structure, leave the world and enter again. - A missing registry warning (
block named X used in a blocks.json file does not exist in the registry) means the block JSON failed to load or the pack was not fully reloaded. Look at the earlier block error first. - Check the collision box by dropping the player from above and seeing the height they stand at, and the selection box by its outline.
Further reading
- Blocks: format_version, file locations and names, custom components, states, traits, permutations, multi-block, block entities, frames and shelves, geometry and boxes, material_instances, tags and other components, what blocks cannot do
- Block community reports: definition and custom components, geometry, rendering, mining, placement
- Block rendering: choosing a render method, AO and lighting bugs
- Textures and atlases:
terrain_texture.json, size rules, flipbooks - Models and geometry: geometry folders and identifiers
- Entities, items, custom components: handler list, parameters
- Content and rendering claims measured: measurement record of the minimal example
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
private-research | Private research (-) | - | 2026-11-13 | |
bedrock-wiki | Bedrock Wiki | CC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository) | 0930b39 | 2026-11-13 |
ms-learn | Minecraft Creator documentation (Microsoft Learn) | CC BY 4.0 (documentation), MIT (code) | a9fd1c0 | 2026-11-13 |
bedrock-samples | Mojang bedrock-samples | Minecraft EULA applies, (c) Mojang AB. All rights reserved | 15701fa9 (guide baseline 46ba6ea) | 2026-11-13 |
repo-guide | JSON UI comprehensive guide (this repository) (guide/) | This project's material | 2026-11-13 |