Skip to main content

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 wantMethod in this guideWhen 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 onScript custom components (blockComponentRegistry)Block events (events, minecraft:on_placed) were removed
Store items inside a blockcontainer of minecraft:block_entityNeeds the Upcoming Creator Features experiment
Draw the stored items on the block like an item frame or shelfNot 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_meshBlock geometry is cubes only, up to about 30px per axisSeveral blocks, a multi-block, or an entity
Change the JSON, model, loot or behavior of a vanilla blockAdd-ons cannot change itRemove the drops and create new ones with a script
Falling blocks, animated models, custom fluids, sign textNot possible as a blockAn entity or a script
Define the block in server code without a BPThis guide is not enoughSending 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, only sound is valid in blocks.json; a textures entry gives the error trying to override the Geometry component with blocks.json settings.
  • wiki:toggle stays only in the base components, and the permutation holds only material_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_version in game version form like 1.26.30. "26.30" does not work, and a version newer than the game gives Unexpected version for the loaded data {single report}.
  • Block format_version needed per feature: custom components 1.21.90 or later, connection_rule and the new traits 1.26.0 or later, the minecraft:tags array 1.26.20 or later. Only the value in the block file matters.
  • Structure: identifier, menu_category, states, traits inside description. permutations directly under minecraft:block. Every component inside components. A component outside components is ignored without an error.
  • Give identifiers a namespace and no capital letters. State names need a namespace too (wiki:on).
  • menu_category.category is lowercase (construction). Capitals or the typo menu_catagory hide 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 condition reads only the block's own states (q.block_state('ns:name')). Do not repeat the same condition.
  • Trait states (minecraft:cardinal_direction, minecraft:block_face and others) can be read only after the trait is turned on in traits. Otherwise you get making use of non-registered block state.
  • A block with minecraft:geometry needs minecraft:material_instances. A format 1.26.20 block with material_instances and no geometry is not registered and logs nothing {measured}.
  • material_instances keys are face names (up, down, north, south, east, west), bone or Blockbench face names, and the default *. Fields are texture (not textures), render_method, face_dimming, ambient_occlusion, tint_method, isotropic.
  • The texture value is a texture_data key of RP/textures/terrain_texture.json (not a path). Vanilla textures must be defined in this file too.
  • Instances of one block cannot mix render_method values (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_box is 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 in origin terms {measured}.
  • minecraft:selection_box takes only one origin/size object, with a height limit of 16. An array or min/max is 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_visibility inside the minecraft:geometry object; from 1.26.20 write the values as "true"/"false" strings or Molang (MCPE-238524).
  • From 1.26.20 ambient_occlusion is a number (0 to 10). A boolean gives a misleading invalid string error.
  • Write a custom component directly in components as "ns:id": {} and register it with blockComponentRegistry.registerCustomComponent in system.beforeEvents.startup. The BP manifest needs a script module and @minecraft/server 2.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 RP texts/en_US.lang.

Common mistakes​

SymptomCauseFix
/give gives a syntax error and the log is emptymaterial_instances without minecraft:geometryAdd minecraft:geometry.full_block or a custom geometry {measured}
The block is missing from creativemenu_category is outside description, or the value has capitals or a typoPut a lowercase category inside description
The texture is a purple and black gridThe texture value differs from the terrain_texture.json key, the path has .png, or the JSON is a BOM fileMatch the key, drop the extension, save as UTF-8 without BOM
trying to override the Geometry component with blocks.json settingsA geometry block has blocks.json texturesKeep only sound in blocks.json
The custom blocks of a subchunk all vanish, with A block must have baked material data in order to tessellateOne block's geometry is too large or invalidShrink the model to about 30px and use cubes only
Total length of parts for schematic ... greater than 1 + 14/16thsThe model goes more than 14px outside the unit cellSplit the model, or use a multi-block or an entity
is not included within the unit cubepoly_mesh or a locatorUse cubes
Faces have holes in game but look fine in BlockbenchBox UV only, no per-face UVUse per-face uv and uv_size, and delete faces that should not show
Transparent pixels look blackopaque with transparent pixelsPick alpha_test, alpha_test_single_sided or blend
MaterialInstances can't mix and matchInstances have different render_method valuesUse one render method per block
collision_box: too many input elements, expected no more than 1617 or more boxesUse 16 or fewer {measured}
Block type ... not found after changing box valuesA box is outside the allowed area, or selection_box is an arrayKeep 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 SchemaThe 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 blockformat_version too low or the component in the wrong placeBlock format 1.21.90 or later, inside components
A custom component is not called in some statesAnother 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 DescriptionThe state name has no namespaceWrite it as ns:name
making use of non-registered block stateA trait state was read without turning the trait onAdd it to enabled_states in traits
The block stops registering after adding tagsThe tag form does not match the block format_versionminecraft:tags array for 1.26.20 or later, tag: components below that {measured}
TypeError: not a function (block.getState)Block has no getStateUse block.permutation.getState {measured}
Changes to the script or block JSON do not showRegistration happens only in startup, and /reload does not rerun startupLeave the world and enter again
You cannot place a block next to the blockonPlayerInteract blocks ordinary use and placementSneak to place, or use world.beforeEvents.playerInteractWithBlock to avoid blocking
The last log line is Unexpected version for the loaded dataIt follows an earlier real errorScroll 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_occlusion is a number, bone_visibility values are strings, tags are the minecraft:tags array. Error messages carry no location.
  • From format 1.26.60, collision_box written with min/max needs Upcoming Creator Features. origin/size works without the experiment {measured}.
  • dynamic_properties of minecraft:block_entity is not experimental from 26.50. container needs 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, onPlayerInteract and beforeOnPlayerPlace are 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​

  1. Put the BP in development_behavior_packs and the RP in development_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.
  2. Turn on the Content Log GUI under Creator in the settings and enter the world.
  3. Find the block in its creative category or use /give @s wiki:toggle_block. If /give gives a syntax error, the block was not registered.
  4. Place and use the block. For the example, each use switches the texture between toggle_off and toggle_on.
  5. 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.
  6. 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.
  7. 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.
  8. 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​

Sources
idSourceLicenseCommitAccessed
private-researchPrivate research (-)-2026-11-13
bedrock-wikiBedrock WikiCC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository)0930b392026-11-13
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13
bedrock-samplesMojang bedrock-samplesMinecraft EULA applies, (c) Mojang AB. All rights reserved15701fa9 (guide baseline 46ba6ea)2026-11-13
repo-guideJSON UI comprehensive guide (this repository) (guide/)This project's material2026-11-13