Skip to content

Adjacent Blocks

Provides the count of blocks adjacent to a block at a specific position that fulfill a condition.

Type ID: kaya:adjacent_blocks

Info

This type provides the following context parameters when checking the adjacent blocks:

Parameter Description
kaya:adjacent_block The block adjacent to the block at a position.

Format

Field Type Default Description
condition Condition The condition to check on the adjacent blocks.
position Vec3 Provider The position of a block to check the blocks adjacent to it.

Example

{
    "type": "kaya:adjacent_blocks",
    "condition": {
        "type": "kaya:check_block_type",
        "key": "minecraft:dirt",
        "block": "adjacent_block"
    },
    "position": {
        "type": "kaya:block/position",
        "block": "used_block"
    }
}

This example counts how many blocks adjacent to the block provided by the kaya:used_block context parameter is a Dirt block.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.

b