{
  "format_version": "1.20.50",
  "minecraft:block": {
    "description": {
      "identifier": "rc:chute",
      "menu_category": {
        "group": "itemGroup.name.create",
        "category": "Items"
      },
      "states": {
        "rc:state": [ "default", "diagonal", "full", "windowed", "box" ],
        "rc:lado": [0,1,2,3,4,5,6]
      }
    },
    "components": {
      "minecraft:selection_box": {
        "origin": [ -8, 0, -8],
        "size": [ 16, 16, 16 ]
    },
    "minecraft:collision_box": {
      "origin": [ -8, 0, -8],
      "size": [ 16, 16, 16 ]
    },
      "minecraft:material_instances": {
        "*": {
          "texture": "chute_deafult",
          "render_method": "alpha_test"
        }
      },
      "minecraft:on_player_placing": {
        "event": "rotation",
        "target": "self"
      },
      "minecraft:geometry": { 
         "identifier": "geometry.chute_default"
       },
       "minecraft:queued_ticking": {
         "interval_range": [
           20,
           20
         ],
         "looping": true,
         "on_tick": {
           "event": "ticking"
         }
       },
      "minecraft:destructible_by_mining": {
        "seconds_to_destroy": 0.3
      }
    },
    "events": {
      "ticking":{
        "sequence":[
          {
        "run_command":{
          "command":[
            "scriptevent rc:chute"
          ]
        }
      }
    ]
      },
      "rotation": {
      "sequence":[
        {
        "set_block_state": {
          "rc:lado": "(query.cardinal_block_face_placed_on)"
            }
          }
        ]
      }
    },
    "permutations": [
      {
        "condition": "query.block_state('rc:lado') == 2",
        "components": {
          "minecraft:transformation": {
            "rotation": [0, 0, 0]
          }
        }
      },
      {
        "condition": "query.block_state('rc:lado') == 3",
        "components": {
          "minecraft:transformation": {
            "rotation": [0, 180, 0]
          }
        }
      },
      {
        "condition": "query.block_state('rc:lado') == 4",
        "components": {
          "minecraft:transformation": {
            "rotation": [0, 90, 0]
          }
        }
      },
      {
        "condition": "query.block_state('rc:lado') == 5",
        "components": {
          "minecraft:transformation": {
            "rotation": [0, 270, 0]
          }
        }
      },
      {
        "condition": "query.block_state('rc:state') == 'default'",
        "components": {
          "minecraft:geometry": { 
             "identifier": "geometry.chute_default"
           },
           "minecraft:material_instances": {
             "*": {
               "texture": "chute_default",
               "render_method": "alpha_test"
             }
           }
        }
      },
      {
        "condition": "query.block_state('rc:state') == 'windowed'",
        "components": {
          "minecraft:geometry": { 
             "identifier": "geometry.chute_windowed"
           },
           "minecraft:material_instances": {
             "*": {
               "texture": "chute_windowed",
               "render_method": "alpha_test"
             }
           }
        }
      },
      {
        "condition": "query.block_state('rc:state') == 'diagonal'",
        "components": {
          "minecraft:geometry": { 
             "identifier": "geometry.chute_diagonal"
           },
           "minecraft:material_instances": {
             "*": {
               "texture": "chute_diagonal",
               "render_method": "alpha_test"
             }
           }
        }
      },
      {
        "condition": "query.block_state('rc:state') == 'full'",
        "components": {
          "minecraft:geometry": { 
             "identifier": "geometry.chute_full"
           },
           "minecraft:material_instances": {
             "*": {
               "texture": "chute_full",
               "render_method": "alpha_test"
             }
           }
        }
      },
      {
        "condition": "query.block_state('rc:state') == 'box'",
        "components": {
          "minecraft:geometry": { 
             "identifier": "geometry.chute_box"
           },
           "minecraft:material_instances": {
             "*": {
               "texture": "chute_box",
               "render_method": "alpha_test"
             }
           }
        }
      }
    ]
  }
}