{
  "format_version": "1.20.50",
  "minecraft:block": {
    "description": {
      "identifier": "rc:brass_funnel",
      "menu_category": {
        "group": "itemGroup.name.create",
        "category": "Items"
      },
      "states": {
        "rc:lado": [ 2, 3, 4, 5 ],
        "rc:state":["pushing", "pulling", "retracted", "extended"],
        "rc:belt":[0,1]
      }
    },
    "components": {
      "minecraft:transformation": {
        "rotation": [0, 180, 0]
      },
      "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": "funnel_retracted",
          "render_method": "blend",
          "face_dimming": false,
          "ambient_occlusion": false
        }
      },"minecraft:on_player_placing": {
        "event": "placed",
        "target": "self"
      },
      "minecraft:geometry": { 
         "identifier": "geometry.funnel_retracted"
       },
       "minecraft:queued_ticking": {
         "interval_range": [
           20,
           20
         ],
         "looping": true,
         "on_tick": {
           "event": "ticking"
         }
       },
       "minecraft:on_interact":{
         "event":"interacting"
       },
      "minecraft:destructible_by_mining": {
        "seconds_to_destroy": 0.3
      }
    },
    "events": {
      "ticking":{
        "sequence":[
          {
        "run_command":{
          "command":[
            "scriptevent rc:brass_funnel"
          ]
        }
      }
    ]
      },
      "interacting": {
        "run_command":{
          "command":[
            "execute as @p at @p run scriptevent rc:funnel_interact"
          ]
        }
      },
  "placed": {
    "sequence":[
      {
    "set_block_state": {
      "rc:lado": "(query.cardinal_facing_2d)"
            }
          }
        ]
      }
    },
    "permutations": [
      {
        "condition": "query.block_state('rc:lado') == 3",
        "components": {    
          "minecraft:transformation": {
            "rotation": [0, 0, 0]
          }
        }
    },
    {
        "condition": "query.block_state('rc:lado') == 5",
        "components": {    
          "minecraft:transformation": {
            "rotation": [0, 90, 0]
          }
        }
    },
    {
      "condition": "query.block_state('rc:lado') == 2",
      "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:state') == 'pushing'",
      "components": {  
        "minecraft:queued_ticking": {
          "interval_range": [
            20,
            20
          ],
          "looping": true,
          "on_tick": {
            "event": "ticking"
          }
        },
        "minecraft:selection_box": {
          "origin": [ -8, 0, 0],
          "size": [ 16, 16, 8 ]
      },
      "minecraft:collision_box": {
        "origin": [ -8, 0, 0],
        "size": [ 0, 0, 0 ]
      },  
        "minecraft:geometry": { 
           "identifier": "geometry.funnel_default",
           "bone_visibility": {
             "belt": "q.block_state('rc:belt') == 1"
           }
         },  
        "minecraft:material_instances": {
          "*": {
            "texture": "funnel_pushing",
            "render_method": "alpha_test",
            "face_dimming": false,
            "ambient_occlusion": false
            }
          }
        }
      },
  {
      "condition": "query.block_state('rc:state') == 'pulling'",
      "components": { 
        "minecraft:queued_ticking": {
          "interval_range": [
            1,
            1
          ],
          "looping": true,
          "on_tick": {
            "event": "ticking"
          }
        },
        "minecraft:selection_box": {
          "origin": [ -8, 0, 0],
          "size": [ 16, 16, 8 ]
      },
      "minecraft:collision_box": {
        "origin": [ -8, 0, 0],
        "size": [ 0, 0, 0 ]
      },  
        "minecraft:geometry": { 
           "identifier": "geometry.funnel_default",
           "bone_visibility": {
             "belt": "q.block_state('rc:belt') == 1"
           }
         }, 
        "minecraft:material_instances": {
          "*": {
            "texture": "funnel_pulling",
            "render_method": "alpha_test",
            "face_dimming": false,
            "ambient_occlusion": false
            }
          }
        }
      },
  {
      "condition": "query.block_state('rc:state') == 'retracted'",
      "components": {  
        "minecraft:queued_ticking": {
          "interval_range": [
            1,
            1
          ],
          "looping": true,
          "on_tick": {
            "event": "ticking"
          }
        },
        "minecraft:selection_box": {
          "origin": [ -8, 0, 0],
          "size": [ 16, 16, 8 ]
      },
      "minecraft:collision_box": {
        "origin": [ -8, 0, 0],
        "size": [ 0, 0, 0 ]
      },  
        "minecraft:geometry": { 
           "identifier": "geometry.funnel_retracted"
         },  
        "minecraft:material_instances": {
          "*": {
            "texture": "funnel_retracted",
            "render_method": "alpha_test",
            "face_dimming": false,
            "ambient_occlusion": false
            }
          }
        }
      },
  {
      "condition": "query.block_state('rc:state') == 'extended'",
      "components": {    
        "minecraft:geometry": { 
           "identifier": "geometry.funnel_extended"
         },
        "minecraft:material_instances": {
          "*": {
            "texture": "funnel_extended",
            "render_method": "alpha_test",
            "face_dimming": false,
            "ambient_occlusion": false
            }
          }
        }
      }
    ]  
  }
}