概览
minecraft:connection_rule 是一个方块组件:写在自定义方块的 components 对象中。 控制栅栏、墙、铁栏杆和玻璃板放在这个方块旁边时是否会与它连接。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
accepts_connections_from | Connection Type | "all" | 哪些方块可以连接:"all"、"only_fences" 或 "none"。下界砖栅栏不算在 "only_fences" 中。 |
enabled_directions | Direction[] | ["south","north","east","west"] | 允许连接的面(北、东、南、西)。不允许任何连接时会被忽略。 |
示例
写在 BP/blocks/<name>.json 的 components 对象中(值为默认值或占位值):
BP/blocks/<name>.json
{
"minecraft:connection_rule": {
"accepts_connections_from": "all",
"enabled_directions": [
"south",
"north",
"east",
"west"
]
}
}