To setup custom blocks in geyser, you have to choose how you are going to register your blocks. The easiest is [using a json file](#json-mappings) but you can also [use a Geyser extension](#geyser-extensions).
It should be noted that blocks and their associated components are not very stable. Mojang tends to make changes to these much more often than they do for items. This means that any components Geyser allows you to register are liable to break in future versions of Bedrock.
## Enabling custom blocks
Before beginning, ensure that `add-non-bedrock-items` is set to `true` in your `config.yml` file.
```yml
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
add-non-bedrock-items:true
```
## JSON mappings
The JSON mappings use a similar structure to that of behavior packs registering blocks. The equivalent components are listed in the [Minecraft: Bedrock Edition Creator Documentation](https://learn.microsoft.com/en-us/minecraft/creator/reference/content/blockreference/examples/blockcomponents/blockcomponentslist).
Custom mappings files that register blocks or items should be placed in the `custom_mappings` folder. This folder is created when you start your server. It is located in the same folder as the `Geyser-Standalone.jar` file for standalone and inside your Geyser data folder for a plugin. If you do not have this folder, ensure you are on the latest version of Geyser.
- Description: A face that the block can be placed on.
-`block_filter`:
- Type: `array`
- Description: An array of blocks or true molang queries that the block can be placed on.
-`items`:
- Type: `string`
- Description: A block that the block can be placed on.
- Type `object`
- Description: Holds a true molang query that the block can be placed on.
-`tags`:
- Type: `array`
- Description: A true molang query that the block can be placed on.
-`selection_box`:
- Type: `object`
-`origin`:
- Type: `array`
- Default: Inferred from overridden block
- Description: An array of x, y, and z origin values
- Range: Must be in range `[-8, 0, -8]` to `[8, 16, 8]`, inclusive
-`items`:
- Type: `float`
- Default: Inferred from overridden block
- Description: An origin value for a single axis
-`size`:
- Type: `array`
- Default: Inferred from overridden block
- Description: An array of x, y, and z size values
-`items`:
- Type: `float`
- Default: Inferred from overridden block
- Description: An size value for a single axis
- Range: Addittion of `origin` and `size` must be in range `[-8, 0, -8]` to `[8, 16, 8]`, inclusive.
-`tags`:
- Type: `array`
- Description: An array of tags associated with the block.
-`items`:
- Type: `string`
-`transformation`:
- Type: `object`
- Description: Translation, scale, and rotation values to apply to the block.
-`scale`
- Type: `array`
- Default: `[1, 1, 1]`
- Description: An array of x, y, and z scale values
-`items`:
- Type: `float`
- Default: `1`
- Description: A scale value for a single axis
-`translation`:
- Type: `array`
- Default: `[0, 0, 0]`
- Description: An array of x, y, and z translation values
-`items`:
- Type: `float`
- Default: `0`
- Description: A translation value for a single axis
-`rotation`
- Type: `array`
- Default: `[0, 0, 0]`
- Description: An array of x, y, and z rotation values in increments of 90 degrees (e.g. `[90, -180, 0]`)
-`items`:
- Type: `integer`
- Range: `0`, `90`, `180`, & `270`
- Default: `0`
- Description: A rotation value for a single axis
-`unit_cube`:
- Type: `boolean`
- Default: `false`
- Description: Whether a unit cube is to be used with tessellation.
-`creative_category`:
- Type: `string`
- Default: `building_blocks`
- Description: The creative category to place the block in.
- Range: See [Creative Categories](https://wiki.bedrock.dev/documentation/creative-categories.html#list-of-creative-categories) on the Bedrock Wiki.
-`creative_group`:
- Type: `string`
- Default: none
- Description: The creative group to place the block in.
- Range: See [Creative Tabs](https://wiki.bedrock.dev/documentation/creative-categories.html#list-of-creative-tabs) on the Bedrock Wiki.
-`included_in_creative_inventory`:
- Type: `boolean`
- Default: `true`
- Description: Whether the block is included in the creative inventory.
-`only_override_states`:
- Type: `boolean`
- Default: `false`
- Description: Whether the block should only override the states specified in `state_overrides`.
-`state_overrides`:
- Type: `object`
- Description: An object containing state overrides for the block.
-`property1=value1,property2=value2,...`:
- Type: `object`
- Description: An override for a specific block state. Possible states are listed in Geyser's [Block Mappings](https://raw.githubusercontent.com/GeyserMC/mappings/master/blocks.json)
- Accepts all of the same properties as a block definition except `creative_category`, `creative_group`, `included_in_creative_inventory`, `only_override_states`, and `state_overrides`.
</div>
## Geyser extensions
In this example, we will create a custom block that overrides the vanilla redstone dot. This block will be placed on top of a block and will emit a visible redstone signal when powered.
First, create a class that implements Geyser's Extension class:
```java
publicclassRedstoneDotimplementsExtension{
//...
}
```
Next, create a method to register your blocks in the `GeyserDefineCustomBlocksEvent`: