{
  "format_version": "1.20.50",
  "minecraft:block": {
    "description": {
      "identifier": "rc:speedometer",
      "menu_category": {
        "group": "itemGroup.name.create",
        "category": "Items"
      },
      "states": {
        "rc:lado": [ 0, 1, 2, 3, 4, 5 ],
        "rc:direcao": [ "null", "x", "yx", "z" ],
        "rc:speed": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ],
        "rc:sentido": [ "estatico", "horario", "antihorario" ]
      }
    },
    "components": {
      "minecraft:transformation": {
        "rotation": [0, 0, 0]
      },
      "minecraft:selection_box": {
        "origin": [ -8, 0, -8],
        "size": [ 16, 16, 12 ]
    },
    "minecraft:collision_box": {
      "origin": [ -8, 0, -8],
      "size": [ 16, 16, 12 ]
    },"minecraft:on_player_placing": {
        "event": "placed",
        "target": "self"
      },
      "minecraft:material_instances": {
        "*": {
          "texture": "speedometer",
          "render_method": "alpha_test"
        }
      },
      "minecraft:geometry": { 
         "identifier": "geometry.speedometer",
         "bone_visibility": {
           "seta0": "q.block_state('rc:speed') == 0",
           "seta1": "q.block_state('rc:speed') == 1",
           "seta2": "q.block_state('rc:speed') == 2",
           "seta3": "q.block_state('rc:speed') == 3",
           "seta4": "q.block_state('rc:speed') == 4",
           "seta5": "q.block_state('rc:speed') == 5",
           "seta6": "q.block_state('rc:speed') == 6",
           "seta7": "q.block_state('rc:speed') == 7",
           "seta8": "q.block_state('rc:speed') == 8",
           "seta9": "q.block_state('rc:speed') == 9",
           "seta10": "q.block_state('rc:speed') == 10"
         }
       },
       "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:speedometerConnect"
          ]
        }
      }
      ,
      {
        "condition": "query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 1",
        "set_block_state": {
          "rc:direcao": "'yx'"
                }
      },
      {
        "condition": "query.block_state('rc:lado') == 4 || query.block_state('rc:lado') == 5",
        "set_block_state": {
          "rc:direcao": "'z'"
                }
      },
      {
        "condition": "query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 3",
        "set_block_state": {
          "rc:direcao": "'x'"
                }
      }
    ]
      },
  "placed": {
    "sequence":[
      {
    "set_block_state": {
      "rc:lado": "(query.cardinal_facing_2d)"
            }
          }
        ]
      }
    },
    "permutations": [
      {
          "condition": "query.block_state('rc:lado') == 0",
          "components": {
            "minecraft:transformation": {
              "rotation": [0, 0, 0]
            }
          }
      },
      {
        "condition": "query.block_state('rc:lado') == 2 ",
        "components": {    
          "minecraft:transformation": {
            "rotation": [0, 0, 0]
          }
        }
    },
    {
        "condition": "query.block_state('rc:lado') == 4",
        "components": {    
          "minecraft:transformation": {
            "rotation": [0, 90, 0]
          }
        }
    },
    {
        "condition": "query.block_state('rc:lado') == 1",
        "components": {
          "minecraft:transformation": {
            "rotation": [90, 0, 0]
          }
        }
    },
    {
      "condition": "query.block_state('rc:lado') == 3",
      "components": {    
        "minecraft:transformation": {
          "rotation": [0, 180, 0]
        }
      }
  },
  {
      "condition": "query.block_state('rc:lado') == 5",
      "components": {    
        "minecraft:transformation": {
          "rotation": [0, -90, 0]
        }
      }
  },
    {
        "condition": "query.block_state('rc:sentido') == 'estatico' || query.block_state('rc:speed') == 0",
        "components": {    
          "minecraft:material_instances": {
            "*": {
              "texture": "speedometer",
              "render_method": "alpha_test"
            }
          }
        }
    }, {
      "condition": "query.block_state('rc:speed') == 1 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_1",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 2 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_2",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 3 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_3",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 4 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_4",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 5 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_5",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 6 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_6",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 7 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_7",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 8 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_8",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 9 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_9",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 10 && ((query.block_state('rc:sentido') == 'antihorario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'horario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_a_10",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 1 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_1",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 2 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_2",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 3 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_3",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 4 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_4",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 5 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_5",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 6 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_6",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 7 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_7",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 8 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_8",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 9 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_9",
            "render_method": "alpha_test"
          }
        }
      }
  },
  {
      "condition": "query.block_state('rc:speed') == 10 && ((query.block_state('rc:sentido') == 'horario' && (query.block_state('rc:lado') == 0 || query.block_state('rc:lado') == 1 || query.block_state('rc:lado') == 2 || query.block_state('rc:lado') == 5)) || (query.block_state('rc:sentido') == 'antihorario' && ( query.block_state('rc:lado') == 3 || query.block_state('rc:lado') == 4)))",
      "components": {    
        "minecraft:material_instances": {
          "*": {
            "texture": "speedometer_h_10",
            "render_method": "alpha_test"
          }
        }
        }
    }
    ]
  }
}