{
  "format_version": "1.21.60",
  "minecraft:block": {
    "description": {
      "identifier": "mdrb:roof_blue_mdrb",
      "menu_category": {"category": "items"},
      "traits": {
        "minecraft:placement_direction": {
          "enabled_states": ["minecraft:cardinal_direction"]
        }
      },
      "states": {
        "md:north_neighbor": [0, 1],
        "md:east_neighbor" : [0, 1],
        "md:south_neighbor": [0, 1],
        "md:west_neighbor" : [0, 1]
      }
    },
    "permutations": [
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'north'",
        "components": {
          "minecraft:transformation": { "rotation": [0, 180, 0] }
        }
      },
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'east'",
        "components": {
          "minecraft:transformation": { "rotation": [0, 90, 0] }
        }
      },
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'west'",
        "components": {
          "minecraft:transformation": { "rotation": [0, -90, 0] }
        }
      },
      {
        "condition": "(q.block_state('minecraft:cardinal_direction') == 'north' && q.block_state('md:north_neighbor')) || (q.block_state('minecraft:cardinal_direction') == 'south' && q.block_state('md:south_neighbor')) || (q.block_state('minecraft:cardinal_direction') == 'west' && q.block_state('md:west_neighbor')) || (q.block_state('minecraft:cardinal_direction') == 'east' && q.block_state('md:east_neighbor'))",
        "components": {
          "minecraft:geometry": {
            "identifier": "geometry.roof_mdrb",
            "bone_visibility": {
              "main"  : false,
              "corner_out" : true,
              "corner_in": false
            }
          }
        }
      },
      {
        "condition": "(q.block_state('minecraft:cardinal_direction') == 'north' && q.block_state('md:south_neighbor')) || (q.block_state('minecraft:cardinal_direction') == 'south' && q.block_state('md:north_neighbor')) || (q.block_state('minecraft:cardinal_direction') == 'west' && q.block_state('md:east_neighbor')) || (q.block_state('minecraft:cardinal_direction') == 'east' && q.block_state('md:west_neighbor'))",
        "components": {
          "minecraft:geometry": {
            "identifier": "geometry.roof_mdrb",
            "bone_visibility": {
              "main"  : false,
              "corner_out" : false,
              "corner_in": true
            }
          }
        }
      }
    ],
    "components": {
      "tag:mdrb:roof": {},
      "minecraft:geometry": {
        "identifier": "geometry.roof_mdrb",
        "bone_visibility": {
          "main"  : true,
          "corner_out"  : false,
          "corner_in"  : false
        }
      },
      "minecraft:material_instances": {
        "*": {
          "texture": "roof_blue_mdrb",
          "render_method": "alpha_test_single_sided_to_opaque"
        }
      },
      "minecraft:collision_box": {
        "origin": [-8,  0, -8],
        "size"  : [16, 8, 16]
      },
      "minecraft:selection_box": true,
      "minecraft:light_dampening": 0,
      "minecraft:custom_components": [
        "md:horizontal_full_connected",
        "md:horizontal_full_destroy"
      ]
    }
  }
}