Wiki 9Minecraft Wiki 9Minecraft

Creating Custom Glass Blocks

How to build see-through and tinted glass blocks using material instances and geometry.

5Sections
3Code examples
4Known errors

Custom glass requires a specific combination of geometry, material instances, and light dampening components to prevent the game from rendering the block as a solid, dark cube. Unlike standard opaque blocks, a glass block must tell the rendering engine how to handle pixel transparency and whether adjacent blocks should cull their touching faces. You will use this setup whenever you create windows, crystal blocks, ice, or tinted barriers.

How Transparency Works in Bedrock

By default, Minecraft Bedrock treats every custom block as a solid, opaque full cube. If you apply a texture with transparent or semi-transparent pixels to a basic block definition, those pixels will render as pitch black or solid white in the world. Furthermore, the game will automatically hide (cull) the faces of any solid blocks placed directly behind your custom block, allowing players to see straight through the world like an X-ray glitch.

To make a functional glass block, you have to override three systems in the Behavior Pack: the geometry definition, the material render method, and the light dampening value. Once you shift a block away from the default unit cube to a custom geometry, you gains control over face culling and transparency sorting.

The Behavior Pack Block Definition

All modern custom glass blocks start in the Behavior Pack. Even if your glass is a simple 16x16x16 cube, you must explicitly include the `minecraft:geometry` component using the built-in `minecraft:geometry.full_block` identifier. Using this identifier instead of the default unit cube stops the engine from automatically culling the faces of solid dirt or stone blocks placed next to your glass.

Next, you must set `minecraft:light_dampening` to 0. Standard blocks have a dampening value of 15, which completely blocks sky and block light. A value of 0 lets light pass entirely through the block without losing intensity, and prevents ugly dark shadows from appearing on the glass surface itself.

Finally, the `minecraft:material_instances` component links your texture shortname to a specific render method. Below is a complete definition for a clear glass block with crisp, fully transparent cutouts.

BP/blocks/clear_glass.json
{
  "format_version": "1.20.80",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:clear_glass",
      "menu_category": {
        "category": "construction"
      }
    },
    "components": {
      "minecraft:geometry": "minecraft:geometry.full_block",
      "minecraft:material_instances": {
        "*": {
          "texture": "wiki_clear_glass",
          "render_method": "alpha_test",
          "ambient_occlusion": false,
          "face_dimming": false
        }
      },
      "minecraft:light_dampening": 0,
      "minecraft:destructible_by_mining": {
        "seconds_to_destroy": 0.45
      }
    }
  }
}

Choosing a Render Method

The `render_method` field inside `minecraft:material_instances` dictates how the game reads the alpha channel of your PNG texture. Choosing the wrong method is the most common reason custom glass looks broken in-game.

Use `alpha_test` for standard, non-stained glass where pixels are either 100% opaque (the frame and streaks) or 100% invisible. Use `blend` for stained or tinted glass where the texture contains translucent pixels (for example, 50% opacity). Keep in mind that `blend` is more expensive to render and can sometimes sort oddly when looking through multiple layers of water, ice, or other blended blocks.

Render MethodWhat it doesNotes
opaqueIgnores the alpha channel completely.Default. Transparent pixels turn black or white.
alpha_testPixels are either fully solid or fully invisible.Best for clear glass frames, grates, and iron bars.
blendSupports partial transparency and soft opacity.Required for stained glass, tinted glass, and ice.
double_sidedRenders both the front and back of each face.Opaque only; do not use for glass.

Texture Registration and Sounds

Your texture PNG must be saved with an alpha channel (32-bit RGBA) and placed in your Resource Pack under `RP/textures/blocks/`. You then assign it the shortname used in the behavior file (`wiki_clear_glass`) inside `terrain_texture.json`.

While `blocks.json` in the Resource Pack is no longer needed for basic texture mapping on custom blocks, you still need an entry there if you want your block to play the vanilla glass shattering sound when broken or walked on.

RP/textures/terrain_texture.json
{
  "resource_pack_name": "wiki_glass_rp",
  "texture_name": "atlas.terrain",
  "padding": 8,
  "num_mip_levels": 4,
  "texture_data": {
    "wiki_clear_glass": {
      "textures": "textures/blocks/clear_glass"
    }
  }
}

Assigning the Glass Sound

Add your block's full identifier to `RP/blocks.json` and set the `sound` property to `glass`. Without this entry, the block will play a generic stone thud when placed or broken. Do not declare `textures` inside `RP/blocks.json` when using `minecraft:material_instances` in the Behavior Pack, as mixing the legacy and modern systems can override your render method.

RP/blocks.json
{
  "format_version": [
    1,
    1,
    0
  ],
  "wiki:clear_glass": {
    "sound": "glass"
  }
}

Which versions this applies to

Applies to Bedrock Edition 1.20.80 and newer. All components used on this page (`minecraft:geometry`, `minecraft:material_instances`, `minecraft:light_dampening`) are stable and do not require any experimental toggles.

When it does not work

What you seeWhyThe fix
Placing the glass block against stone or dirt lets you see straight into the void through the ground.You either used `minecraft:unit_cube` or omitted `minecraft:geometry` entirely, causing the engine to treat the glass as an opaque full block that culls adjacent faces.Add `"minecraft:geometry": "minecraft:geometry.full_block"` to your block's components.
The transparent parts of the glass texture appear solid black or solid white in the world.Either `render_method` is missing (defaulting to `opaque`), or you defined the block's texture inside `RP/blocks.json`, which overrides your material instance.Ensure `render_method` is set to `alpha_test` or `blend` in the Behavior Pack, and remove any `textures` key from this block's entry in `RP/blocks.json`.
Stained glass texture is completely invisible except for the solid border.You used `alpha_test` on a texture whose center pixels have an opacity below 50%. `alpha_test` discards semi-transparent pixels below its threshold.Change `render_method` from `alpha_test` to `blend` inside `minecraft:material_instances`.
The glass block looks dark and muddy even when placed under direct sunlight.The block is absorbing light and applying corner shadows to itself like a solid block.Set `"minecraft:light_dampening": 0` in the components list, and set both `"ambient_occlusion": false` and `"face_dimming": false` inside your material instance.

Reference, straight from the game files

Read out of the game itself, so the ids match the version you are building for.