{
  "format_version": "1.21.80",
  "minecraft:block": {
    "description": {
      "identifier": "drz:door_white_drz",
      "menu_category": {"category": "items"},
      "traits": {
        "minecraft:placement_direction": {
          "enabled_states": ["minecraft:cardinal_direction"]
        }
      },
      "states": {
        "drz:mirror" : [false, true],
        "drz:is_open": [false, true],
        "drz:door_type": ["top", "middle", "bottom", "bottom_2"]
      }
    },
    "permutations": [
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'north' && !q.block_state('drz:is_open')",
        "components": {
          "minecraft:transformation": { "rotation": [0, 180, 0] }
        }
      },
      {
        "condition": "query.block_state('minecraft:cardinal_direction') == 'east' && !q.block_state('drz:is_open')",
        "components": {
          "minecraft:transformation": { "rotation": [0, 90, 0] }
        }
      },
      {
        "condition": "query.block_state('minecraft:cardinal_direction') == 'west' && !q.block_state('drz:is_open')",
        "components": {
          "minecraft:transformation": { "rotation": [0, -90, 0] }
        }
      },
      {
        "condition": "((q.block_state('minecraft:cardinal_direction') == 'south' && !q.block_state('drz:mirror')) || (q.block_state('minecraft:cardinal_direction') == 'north' && q.block_state('drz:mirror'))) && q.block_state('drz:is_open')",
        "components": {
          "minecraft:transformation": {
            "rotation"   : [0, 90, 0],
            "translation": [0.875,  0, 0]
          }
        }
      },
      {
        "condition": "((q.block_state('minecraft:cardinal_direction') == 'north' && !q.block_state('drz:mirror')) || (q.block_state('minecraft:cardinal_direction') == 'south' && q.block_state('drz:mirror'))) && q.block_state('drz:is_open')",
        "components": {
          "minecraft:transformation": {
            "rotation"   : [ 0, -90, 0],
            "translation": [-0.875, 0, 0]
          }
        }
      },
      {
        "condition": "((q.block_state('minecraft:cardinal_direction') == 'east' && !q.block_state('drz:mirror')) || (q.block_state('minecraft:cardinal_direction') == 'west' && q.block_state('drz:mirror'))) && q.block_state('drz:is_open')",
        "components": {
          "minecraft:transformation": {
            "rotation"   : [0, 180,  0],
            "translation": [0,   0, -0.875]
          }
        }
      },
      {
        "condition": "((q.block_state('minecraft:cardinal_direction') == 'west' && !q.block_state('drz:mirror')) || (q.block_state('minecraft:cardinal_direction') == 'east' && q.block_state('drz:mirror'))) && q.block_state('drz:is_open')",
        "components": {
          "minecraft:transformation": { "translation": [0, 0, 0.875] }
        }
      }
    ],
    "components": {
      "tag:1x3": {},
      "tag:drz:door": {},
      "tag:minecraft:is_axe_item_destructible": {},
      "tag:decorize": {},
      "minecraft:geometry": {
        "identifier": "geometry.door_drz",
        "culling": "drz:door",
        "bone_visibility": {
          "top": "!q.block_state('drz:mirror') && q.block_state('drz:door_type') == 'top'",
          "mid": "!q.block_state('drz:mirror') && q.block_state('drz:door_type') == 'middle'",
          "bottom": "!q.block_state('drz:mirror') && (q.block_state('drz:door_type') == 'bottom' || q.block_state('drz:door_type') == 'bottom_2')",
          "handle": "!q.block_state('drz:mirror') && q.block_state('drz:door_type') == 'middle'",
          "top2": "q.block_state('drz:mirror') && q.block_state('drz:door_type') == 'top'",
          "mid2": "q.block_state('drz:mirror') && q.block_state('drz:door_type') == 'middle'",
          "bottom2": "q.block_state('drz:mirror') && (q.block_state('drz:door_type') == 'bottom' || q.block_state('drz:door_type') == 'bottom_2')",
          "handle2": "q.block_state('drz:mirror') && q.block_state('drz:door_type') == 'middle'"
        }
      },
      "minecraft:material_instances": {
        "*": {"texture": "wood_vinyl_white_drz", "render_method": "alpha_test_single_sided_to_opaque"},
        "1": {"texture": "window_1_drz", "render_method": "alpha_test_single_sided_to_opaque"},
        "2": {"texture": "metal_gray_drz", "render_method": "alpha_test_single_sided_to_opaque"}
      },
      "minecraft:destruction_particles": {
        "texture": "wood_vinyl_white_drz"
      },
      "minecraft:item_visual": {
         "geometry": {
           "identifier":"geometry.door_drz.item"
         },
         "material_instances": {
            "*": {"texture": "wood_vinyl_white_drz", "render_method": "alpha_test_single_sided_to_opaque"},
            "1": {"texture": "window_1_drz", "render_method": "alpha_test_single_sided_to_opaque"},
            "2": {"texture": "metal_gray_drz", "render_method": "alpha_test_single_sided_to_opaque"}
        }
      },
      "minecraft:collision_box": {
        "origin": [-8,  0, -8],
        "size"  : [16, 16,  2]
      },
      "minecraft:selection_box": {
        "origin": [-8,  0, -8],
        "size"  : [16, 16,  2]
      },
      "minecraft:destructible_by_mining":{
        "seconds_to_destroy": 1
      },
      "minecraft:destructible_by_explosion": false,
      "minecraft:light_dampening": 0,
      "minecraft:liquid_detection": {
        "detection_rules": [
          {
            "can_contain_liquid": true
          }
        ]
      },
      "minecraft:custom_components": [
        "drz:door"
      ]
    }
  }
}