1. Wiki
  2. /Blocks
  3. /minecraft:connection_rule

minecraft:connection_rule

Don't want to write this by hand? GodCraft sets minecraft:connection_rule for you with a switch.Get GodCraft

Overview

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

FieldTypeDefaultDescription
accepts_connections_fromConnection Type"all"Which blocks may connect: "all", "only_fences" or "none". Nether brick fences do not count for "only_fences".
enabled_directionsDirection[]["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"
    ]
  }
}

Blocks: Behavior pack

We use cookies to improve your experience and analyse site traffic. Learn more