> ## Documentation Index
> Fetch the complete documentation index at: https://docs.znproject.my.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom generator

> Define custom generator patterns by selecting required left, right, and optional under blocks, then configure output blocks and valid tools.

You can create a custom generator with the blocks you choose. Enable it by setting `config.enableCustomGenerator` to `true`, then edit the left block, right block, and the blocks it spawns.

To make the generator work, break a block in the middle first. If there is no block in the middle, place one.

## Enable custom generator

```javascript theme={null}
config.enableCustomGenerator = true
```

## Left, right, and under blocks

```javascript theme={null}
{
  left_block: ["LEFT BLOCK"],
  right_block: ["RIGHT BLOCK"],
  under_block: [],
  blocks: [
    // ...
  ]
}
```

For a grass block on the left, use `minecraft:grass_block`. For stone on the right, use `minecraft:stone`. To require a netherite block underneath, set `under_block: ["netherite_block"]`. If you do not need an under block, leave it as an empty array.

Add the `minecraft:` namespace before a vanilla Minecraft block identifier.

## Generator blocks

See [Generator blocks and chances](https://docs.znproject.my.id/ccbg/configuration/generator-blocks-and-chances.md).

## Example configuration

```javascript theme={null}
config.customGenerator = [
  {
    left_block: ["minecraft:stone"],
    right_block: ["minecraft:dripstone_block"],
    under_block: [],
    blocks: [
      { identifier: "stone", chance: 14 },
      { identifier: "coal_block", chance: 13 },
      { identifier: "iron_block", chance: 13 },
      { identifier: "copper_block", chance: 12 },
      { identifier: "gold_block", chance: 11 },
      { identifier: "redstone_block", chance: 11 },
      { identifier: "lapis_block", chance: 11 },
      { identifier: "diamond_block", chance: 10 },
      { identifier: "emerald_block", chance: 5 }
    ],
    tools: [
      "minecraft:iron_pickaxe",
      "minecraft:gold_pickaxe",
      "minecraft:diamond_pickaxe",
      "minecraft:netherite_pickaxe",
    ]
  },
  {
    left_block: ["minecraft:flowing_water", "minecraft:water", "WATERLOGGED"],
    right_block: ["minecraft:flowing_lava", "minecraft:lava"],
    under_block: ["minecraft:netherite_block"],
    blocks: [
      { identifier: "stone", chance: 20 },
      { identifier: "iron_block", chance: 20 },
      { identifier: "gold_block", chance: 17.5 },
      { identifier: "diamond_block", chance: 17.5 },
      { identifier: "emerald_block", chance: 15 },
      { identifier: "netherite_block", chance: 10 }
    ],
    tools: [
      "minecraft:iron_pickaxe",
      "minecraft:gold_pickaxe",
      "minecraft:diamond_pickaxe",
      "minecraft:netherite_pickaxe",
    ]
  }
]
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.