{
  "format_version": "1.21.70",
  "minecraft:block": {
    "description": {
      "identifier": "mnp_ci:stairs_collision",
      "menu_category": {
        "category": "none",
        "is_hidden_in_commands": true
      },
      "traits": {
        "minecraft:placement_position": {
          "enabled_states": ["minecraft:vertical_half"]
        },
        "minecraft:placement_direction": {
          "enabled_states": ["minecraft:cardinal_direction"]
        }
      },
      "states": {
        "mnp_ci:corner": [false, true],
        "mnp_ci:stair_type": [1, 2, 3, 4, 5]
      }
    },
    "components": {
      "minecraft:custom_components": ["mnp_ci:stairs"],
      "minecraft:geometry": "geometry.mnp_ci.stair_collision",
      "minecraft:liquid_detection": {
        "detection_rules": [
          {
            "liquid_type": "water",
            "can_contain_liquid": true,
            "on_liquid_touches": "no_reaction"
          }
        ]
      },
      "minecraft:material_instances": {
        "*": {
          "texture": "mnp_ci:empty",
          "render_method": "alpha_test"
        }
      },
      "minecraft:destruction_particles": {
        "texture": "mnp_ci:empty"
      },
      "minecraft:loot": "loot_tables/empty.json",
      "minecraft:selection_box": false,
      "minecraft:destructible_by_explosion": false,
      "minecraft:destructible_by_mining": false,
      "minecraft:flammable": false,
      "minecraft:redstone_conductivity": {
        "allows_redstone_to_step_down": false,
        "redstone_conductor": false
      },
      "minecraft:replaceable": {}
    },
    "permutations": [
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'north'",
        "components": {
          "minecraft:transformation": { "rotation": [0, 0, 0] }
        }
      },
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'west'",
        "components": {
          "minecraft:transformation": { "rotation": [0, 90, 0] }
        }
      },
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'south'",
        "components": {
          "minecraft:transformation": { "rotation": [0, 180, 0] }
        }
      },
      {
        "condition": "q.block_state('minecraft:cardinal_direction') == 'east'",
        "components": {
          "minecraft:transformation": { "rotation": [0, -90, 0] }
        }
      },

      // Regular (non-corner) collision boxes
      // Base orientation: north-facing stair extends northward (toward player)
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'bottom' && !q.block_state('mnp_ci:corner') && q.block_state('mnp_ci:stair_type') < 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 0, -8],
            "size": [16, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'bottom' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'east' && q.block_state('mnp_ci:stair_type') == 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 0, 0],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'bottom' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'west' && q.block_state('mnp_ci:stair_type') == 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 0, -8],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'bottom' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'north' && q.block_state('mnp_ci:stair_type') == 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 0, 0],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'bottom' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'south' && q.block_state('mnp_ci:stair_type') == 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 0, -8],
            "size": [8, 0.001, 8]
          }
        }
      },

      {
        "condition": "q.block_state('minecraft:vertical_half') == 'bottom' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'east' && q.block_state('mnp_ci:stair_type') == 5",
        "components": {
          "minecraft:collision_box": {
            "origin": [0, 0, -8],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'bottom' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'west' && q.block_state('mnp_ci:stair_type') == 5",
        "components": {
          "minecraft:collision_box": {
            "origin": [0, 0, 0],
            "size": [8, 0.001, 8]
          }
        }
      },

      {
        "condition": "q.block_state('minecraft:vertical_half') == 'bottom' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'north' && q.block_state('mnp_ci:stair_type') == 5",
        "components": {
          "minecraft:collision_box": {
            "origin": [0, 0, -8],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'bottom' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'south' && q.block_state('mnp_ci:stair_type') == 5",
        "components": {
          "minecraft:collision_box": {
            "origin": [0, 0, 0],
            "size": [8, 0.001, 8]
          }
        }
      },

      {
        "condition": "q.block_state('minecraft:vertical_half') == 'top' && !q.block_state('mnp_ci:corner') && q.block_state('mnp_ci:stair_type') < 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 15.999, -8],
            "size": [16, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'top' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'east' && q.block_state('mnp_ci:stair_type') == 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 15.999, 0],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'top' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'west' && q.block_state('mnp_ci:stair_type') == 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 15.999, -8],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'top' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'north' && q.block_state('mnp_ci:stair_type') == 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 15.999, 0],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'top' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'south' && q.block_state('mnp_ci:stair_type') == 4",
        "components": {
          "minecraft:collision_box": {
            "origin": [-8, 15.999, -8],
            "size": [8, 0.001, 8]
          }
        }
      },

      {
        "condition": "q.block_state('minecraft:vertical_half') == 'top' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'east' && q.block_state('mnp_ci:stair_type') == 5",
        "components": {
          "minecraft:collision_box": {
            "origin": [0, 15.999, -8],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'top' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'west' && q.block_state('mnp_ci:stair_type') == 5",
        "components": {
          "minecraft:collision_box": {
            "origin": [0, 15.999, 0],
            "size": [8, 0.001, 8]
          }
        }
      },

      {
        "condition": "q.block_state('minecraft:vertical_half') == 'top' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'north' && q.block_state('mnp_ci:stair_type') == 5",
        "components": {
          "minecraft:collision_box": {
            "origin": [0, 15.999, -8],
            "size": [8, 0.001, 8]
          }
        }
      },
      {
        "condition": "q.block_state('minecraft:vertical_half') == 'top' && q.block_state('mnp_ci:corner') && q.block_state('minecraft:cardinal_direction') == 'south' && q.block_state('mnp_ci:stair_type') == 5",
        "components": {
          "minecraft:collision_box": {
            "origin": [0, 15.999, 0],
            "size": [8, 0.001, 8]
          }
        }
      }
    ]
  }
}
