Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The minecraft:connection block trait contains information about whether the block connects to other blocks, and if so, on what faces. The values of the states will change when the block or neighboring blocks change or move.
Important
The connection trait requires Bedrock Edition 1.21.130 or higher, and currently requires that the "Upcoming Creator Features" experimental toggle is set on.
There is only one valid state for enabled_states in this trait: minecraft:cardinal_connections.
Queryable block states
When the cardinal_connections state is enabled, you can read one of four block states for connections.
minecraft:connection_northistrueif the block is connected to another block to the north,falseif it is not.minecraft:connection_southistrueif the block is connected to another block to the south,falseif it is not.minecraft:connection_eastistrueif the block is connected to another block to the east,falseif it is not.minecraft:connection_westistrueif the block is connected to another block to the west,falseif it is not.
Example
{
"format_version": "1.21.130",
"minecraft:block": {
"description": {
"identifier": "test:connection_trait_block",
"traits": {
"minecraft:connection": {
"enabled_states": [
"minecraft:cardinal_connections"
]
}
}
},
"permutations": [
{
"condition": "q.block_state('minecraft:connection_north') && !q.block_state('minecraft:connection_south')",
"components": {
// ...
}
}
]
}
}