1. Wiki
  2. /Blocks
  3. /Your first custom block

Your first custom block

Make a glowing ruby block for Minecraft Bedrock: the block file, its texture, sound, name and loot, step by step.

In this guide you will make a Ruby Block: a shiny red cube that glows a little, takes a moment to mine and drops itself when broken. It is the "hello world" of block making, and every fancier block starts the same way.

There are two ways to do it. The quick way takes a few minutes on your phone. The by-hand way teaches you what every file does.

The quick way: GodCraft

GodCraft builds the block, its texture, its name and its loot for you. You never touch a JSON file.

  1. Open the Workshop and add a Block to your add-on.
  2. Paint the faces in the pixel editor, or start from a vanilla texture and recolor it.
  3. Set how long it takes to mine, how much light it gives and what it drops.
  4. Tap Export. GodCraft writes the manifests, UUIDs and language files and gives you a .mcaddon.

Want to know what happens under the hood? Keep reading.

By hand

You need a behavior pack (BP) and a resource pack (RP) that are already set up. If you have not made them yet, follow Project setup first. We will use the namespace myname; replace it with your own short name everywhere.

Here are all the files you will touch:

FilePackWhat it does
blocks/ruby_block.jsonBPWhat the block is and how it behaves
loot_tables/blocks/ruby_block.jsonBPWhat it drops
textures/blocks/ruby_block.pngRPThe picture
textures/terrain_texture.jsonRPGives the picture a short name
blocks.jsonRPThe sound it makes
texts/en_US.langRPThe name players see

Step 1: the block file

Create this file in your behavior pack:

BP/blocks/ruby_block.json
{
  "format_version": "1.26.50",
  "minecraft:block": {
    "description": {
      "identifier": "myname:ruby_block",
      "menu_category": {
        "category": "construction"
      }
    },
    "components": {
      "minecraft:destructible_by_mining": {
        "seconds_to_destroy": 3
      },
      "minecraft:destructible_by_explosion": {
        "explosion_resistance": 6
      },
      "minecraft:friction": 0.4,
      "minecraft:light_emission": 4,
      "minecraft:map_color": "#9b1c2b",
      "minecraft:geometry": "minecraft:geometry.full_block",
      "minecraft:material_instances": {
        "*": {
          "texture": "ruby_block",
          "render_method": "opaque"
        }
      },
      "minecraft:loot": "loot_tables/blocks/ruby_block.json"
    }
  }
}

The description part says who the block is:

  • identifier is the block's ID, made of your namespace and a name. You will type it in commands like /give @s myname:ruby_block.
  • menu_category picks the creative inventory tab. The choices are construction, nature, equipment, items and none (hidden).

The components part says how it behaves:

Different faces

Want a different top and side, like a grass block? Add more keys next to * in material_instances, such as up, down, north, south, east and west. Any face you do not list falls back to *.

Step 2: the texture

Draw a 16x16 pixel PNG and save it in your resource pack as RP/textures/blocks/ruby_block.png.

New to pixel art? The Pixel textures guide covers sizes, transparency and shading.

Step 3: give the texture a short name

Blocks do not point at PNG files directly. They use a short name from terrain_texture.json. If your pack already has this file, add the ruby_block entry to texture_data. If not, create it:

RP/textures/terrain_texture.json
{
  "resource_pack_name": "myname",
  "texture_name": "atlas.terrain",
  "texture_data": {
    "ruby_block": {
      "textures": "textures/blocks/ruby_block"
    }
  }
}

Notice the path has no .png at the end. The game finds the file by itself.

Step 4: the sound

The resource pack's blocks.json tells the game which sound set to play when you walk on, place or break the block:

RP/blocks.json
{
  "format_version": "1.21.40",
  "myname:ruby_block": {
    "sound": "stone"
  }
}

Other common sound sets used by vanilla blocks are wood, glass, metal, grass, sand, cloth, copper and deepslate.

Step 5: the name

Without a name, the game shows something like tile.myname:ruby_block.name. Add this line to your language file:

RP/texts/en_US.lang
tile.myname:ruby_block.name=Ruby Block

Step 6: the loot

The loot table decides what drops. This one drops the block itself, once:

BP/loot_tables/blocks/ruby_block.json
{
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "item",
          "name": "myname:ruby_block"
        }
      ]
    }
  ]
}

Change name to any item ID, like minecraft:diamond, to make the block drop something else.

Test your block

  1. Export and install both packs as shown in Export and install, then turn them on in a world.
  2. Open the creative inventory and look in the Construction tab, or run /give @s myname:ruby_block. See /give.
  3. Place it at night: it should glow softly.
  4. Switch to survival and mine it. It should take a few seconds and drop itself.

Common problems

Purple and black checkerboard

The game cannot find the texture. Check that the short name in material_instances matches the key in terrain_texture.json exactly, and that the path in terrain_texture.json matches the real file location without .png.

  • The block is missing from the inventory. Check menu_category is not none, and that the behavior pack is turned on.
  • The block has a weird name. The .lang line must use the full ID, including the namespace.
  • The block drops nothing. Check the minecraft:loot path starts with loot_tables/ and matches the file name.

More fixes are in Troubleshooting.

What next

We use cookies to improve your experience and analyse site traffic. Learn more