{
   "format_version":"1.16.100",
   "minecraft:block":{
      "description":{
         "identifier":"vatonage:mechanical_cobblestone_generator",
         "register_to_creative_menu":true,
         "properties":{
            "vatonage:signal":[
               0,
               1
            ]
         }
      },
      "components":{
         "minecraft:creative_category":{
            "category":"construction"
         },
         "minecraft:geometry":"geometry.mechanical_cobblestone_generator",
         "minecraft:material_instances":{
            "*":{
               "texture":"mechanical_cobblestone_generator",
               "render_method":"alpha_test"
            }
         },
         "minecraft:pick_collision":{
            "origin":[
               -8,
               0,
               -8
            ],
            "size":[
               16,
               16,
               16
            ]
         },
         "minecraft:entity_collision":{
            "origin":[
               -8,
               0,
               -8
            ],
            "size":[
               16,
               16,
               16
            ]
         },
         "minecraft:destroy_time":0.3,
         "minecraft:block_light_absorption":0
      },
      "events":{
         "vatonage:powered":{
            "sequence":[
               {
                  "set_block_property":{
                     "vatonage:signal":1
                  },
                    "run_command": {
                       "command": [
                          "fill ~ ~-1 ~ ~ ~-1 ~ cobblestone 0 replace air"
                       ]
                    }
               }
            ]
         },
         "vatonage:check_signal":{
            "sequence":[
               {
                  "condition":"q.block_neighbor_has_any_tag(0,0,1,'cogsignal')",
                  "trigger":{
                     "event":"vatonage:powered"
                  }
               },
               {
                  "condition":"q.block_neighbor_has_any_tag(0,0,-1,'cogsignal')",
                  "trigger":{
                     "event":"vatonage:powered"
                  }
               },
               {
                  "condition":"q.block_neighbor_has_any_tag(0,1,0,'cogsignal')",
                  "trigger":{
                     "event":"vatonage:powered"
                  }
               },
               {
                  "condition":"q.block_neighbor_has_any_tag(0,-1,0,'cogsignal')",
                  "trigger":{
                     "event":"vatonage:powered"
                  }
               },
               {
                  "condition":"q.block_neighbor_has_any_tag(1,0,0,'cogsignal')",
                  "trigger":{
                     "event":"vatonage:powered"
                  }
               },
               {
                  "condition":"q.block_neighbor_has_any_tag(-1,0,0,'cogsignal')",
                  "trigger":{
                     "event":"vatonage:powered"
                  }
               }
            ]
         },
         "vatonage:clear_signal":{
            "sequence":[
               {
                  "set_block_property":{
                     "vatonage:signal":0
                  }
               }
            ]
         }
      },
      "permutations":[
         {
            "condition":"query.block_property('vatonage:signal') == 0",
            "components":{
               "minecraft:ticking":{
                  "looping":true,
                  "range":[
                     0.05,
                     0.05
                  ],
                  "on_tick":{
                     "event":"vatonage:check_signal",
                     "target":"self"
                  }
               }
            }
         },
         {
            "condition":"query.block_property('vatonage:signal') == 1",
            "components":{
               "minecraft:ticking":{
                  "looping":true,
                  "range":[
                     0.1,
                     0.1
                  ],
                  "on_tick":{
                     "event":"vatonage:clear_signal",
                     "target":"self"
                  }
               }
            }
         }
      ]
   }
}