# Custom Generator

Do you want a custom generator with the blocks you want? Yes, you can! To enable this, simply set `config.enableCustomGenerator` from `false` to `true`. Then, you can edit the left block, right block, and which blocks it spawns in this configuration.

For your information, you need to break a block in the middle first to make the generator work. You can use all types of blocks. If there is no block, just place one.

### Enabling Custom Generator

You can enable it by changing

```javascript
config.enableCustomGenerator = false
```

to

```javascript
config.enableCustomGenerator = true
```

### Left Block and Right Block

<pre class="language-javascript"><code class="lang-javascript">{
    left_block: ["LEFT BLOCK"], 
    right_block: ["RIGHT BLOCK"],
    under_block: [],
<strong>    blocks: [
</strong>        // ...
<strong>    ]
</strong>}
</code></pre>

To set left block to be `grass block` you can change the code to this

<pre class="language-javascript"><code class="lang-javascript"><strong>{
</strong>    left_block: ["minecraft:grass_block"], 
    right_block: ["RIGHT BLOCK"],
    under_block: [],
<strong>    blocks: [
</strong>        // ...
<strong>    ]
</strong>}
</code></pre>

you need to put `minecraft:` before the block identifier if the block is from vanilla minecraft\
To set right to be `stone` you can change the code to this

<pre class="language-javascript"><code class="lang-javascript">{
    left_block: ["minecraft:grass_block"], 
    right_block: ["minecraft:stone"],
<strong>    blocks: [
</strong>        // ...
<strong>    ]
</strong>}
</code></pre>

To set under block to be `netherite block` you can change the code to this, but if you don't want to leave it to be `[]`

<pre class="language-javascript"><code class="lang-javascript"><strong>{
</strong>    left_block: ["minecraft:grass_block"], 
    right_block: ["minecraft:stone"],
    under_block: ["netherite_block"],
<strong>    blocks: [
</strong>        // ...
<strong>    ]
</strong>}
</code></pre>

### Generator Blocks

For more information adding, changing and removing block from generator:

{% content-ref url="generator-blocks-and-chances" %}
[generator-blocks-and-chances](https://hirzigamingyt.gitbook.io/configuration/generator-blocks-and-chances)
{% endcontent-ref %}

### Example Code

```javascript
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",
		]
	}
]
```
