{
  "format_version": "1.20.50",
  "minecraft:block": {
    "description": {
      "identifier": "rc:mechanical_mixer",
      "menu_category": {
        "group": "itemGroup.name.create",
        "category": "Items"
      },
      "states": {
        "rc:lado": [ 0, 1, 2, 3, 4, 5 ],
        "rc:pos":["null", "white", "black"],
        "rc:direcao": [ "y", "null" ],
        "rc:speed": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ],
        "rc:sentido": [ "estatico", "horario", "antihorario" ],
        "rc:placed": [0,1]
      }
    },
    "components": {
      "minecraft:transformation": {
        "rotation": [0, 0, 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": "cogwheel",
          "render_method": "alpha_test"
        }
      },
      "minecraft:geometry": { 
         "identifier": "geometry.mixer_cogwheel"
       },
       "minecraft:queued_ticking": {
         "interval_range": [
           1,
           1
         ],
         "looping": true,
         "on_tick": {
           "event": "ticking"
         }
       },
      "minecraft:destructible_by_mining": {
        "seconds_to_destroy": 0.3
      }
    },
    "events": {
      "ticking":{
        "sequence":[
          {
        "run_command":{
          "command":[
            "scriptevent rc:mechanical_mixerConnect"
          ]
        }
      }
      ,
      {
        "condition": "query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1",
        "set_block_state": {
          "rc:direcao": "'y'"
                }
      }
    ]
      }
    },
    "permutations": [
      {
          "condition": "query.block_state('rc:placed') == 0",
          "components": {
            "minecraft:geometry": { 
               "identifier": "geometry.mechanical_mixer_block"
             },
             "minecraft:material_instances": {
               "*": {
                 "texture": "mechanical_mixer_block",
                 "render_method": "alpha_test"
               }
            }
          }
      },
      {
          "condition": "query.block_state('rc:pos') == 'white'",
          "components": {
            "minecraft:geometry": { 
               "identifier": "geometry.mixer_cogwheel"
             }
          }
      },
      {
          "condition": "query.block_state('rc:pos') == 'black'",
          "components": {
            "minecraft:geometry": { 
               "identifier": "geometry.mixer_cogwheel2"
             }
          }
      },
      {
          "condition": "query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1",
          "components": {
            "minecraft:transformation": {
              "rotation": [0, 0, 0]
            }
          }
      },
      {
        "condition": "query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 3",
        "components": {    
          "minecraft:transformation": {
            "rotation": [90, 0, 0]
          }
        }
    },
    {
        "condition": "query.block_state('rc:lado') == 4 || query.block_state('rc:lado') == 5",
        "components": {    
          "minecraft:transformation": {
            "rotation": [90, 90, 0]
          }
        }
    },
    {
        "condition": "(query.block_state('rc:sentido') == 'estatico' || query.block_state('rc:speed') == 0) && query.block_state('rc:placed') == 1",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 1",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_1",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 2",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_2",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 3",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_3",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 4",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_4",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 5",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_5",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 6",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_6",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 7",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_7",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 8",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_8",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 9",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_9",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'antihorario' && query.block_state('rc:speed') == 10",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_a_10",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 1",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_1",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 2",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_2",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 3",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_3",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 4",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_4",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 5",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_5",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 6",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_6",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 7",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_7",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 8",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_8",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 9",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_9",
              "render_method": "alpha_test"
            }
          }
        }
    },
    {
        "condition": "query.block_state('rc:sentido') == 'horario' && query.block_state('rc:speed') == 10",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "cogwheel_h_10",
              "render_method": "alpha_test"
            }
          }
        }
    }
    ]
  }
}