minecraft:connection_rule for you with a switch.Get GodCraftOverview
minecraft:connection_rule is a block component: it goes in the components object of a custom block. Controls whether fences, walls, iron bars and glass panes join up with this block when placed next to it.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
accepts_connections_from | Connection Type | "all" | Which blocks may connect: "all", "only_fences" or "none". Nether brick fences do not count for "only_fences". |
enabled_directions | Direction[] | ["south","north","east","west"] | The sides (north, east, south, west) that allow connections. Ignored when nothing is allowed to connect. |
Example
Inside the components object of BP/blocks/<name>.json (values are the defaults or placeholders):
BP/blocks/<name>.json
{
"minecraft:connection_rule": {
"accepts_connections_from": "all",
"enabled_directions": [
"south",
"north",
"east",
"west"
]
}
}