{
  "format_version": "1.16.0",
  "minecraft:block": {
    "description": {
      "identifier": "loled:garden_faucet",
      "properties": {
        "loled:face": [
          1,
          2,
          3,
          4,
          5,
          6
        ],
        "suspraize:active_north": [ false, true ],
        "suspraize:active_south": [ false, true ],
        "suspraize:active_east": [ false, true ],
        "suspraize:active_west": [ false, true ]
      }
    },
    "components": {
      "minecraft:material_instances": {
        "*": {
          "texture": "torneira",
          "render_method": "opaque"
        }
      },
      "minecraft:pick_collision": {
        "origin": [
          -6,
          0,
          -3
        ],
        "size": [
          13,
          13,
          11
        ]
      },
      "minecraft:creative_category": {
        "group": "itemGroup.name.garden",
        "category": "construction"
      },
      "minecraft:loot": "loot_tables/garden/garden_faucet.json",
      "minecraft:geometry": "geometry.torneira",
      "minecraft:destroy_time": 1,
      "minecraft:block_light_absorption": 2,
      "minecraft:entity_collision": {
        "origin": [
          -6,
          0,
          -3
        ],
        "size": [
          13,
          13,
          11
        ]
      },
      "minecraft:on_player_placing": {
        "event": "loled:place"
      },
      "minecraft:friction": 0.6,
      "minecraft:map_color": "#00ff00",
      "minecraft:flammable": {
        "flame_odds": 0,
        "burn_odds": 0
      },
      "minecraft:block_light_emission": 0
    },
    "events": {
      "particle_north": {
        "run_command": {
          "command": [
            "particle water:garden_faucet_north ~~~",
            "playsound ambient.weather.rain @p ~~~ 1 5"
          ]
        }
      },
      "particle_south": {
        "run_command": {
          "command": [
            "particle water:garden_faucet_south ~~~",
            "playsound ambient.weather.rain @p ~~~ 1 5"
          ]
        }
      },

      "particle_west": {
        "run_command": {
          "command": [
            "particle water:garden_faucet_west ~~~",
            "playsound ambient.weather.rain @p ~~~ 1 5"
          ]
        }
      },
      "particle_east": {
        "run_command": {
          "command": [
            "particle water:garden_faucet_east ~~~",
            "playsound ambient.weather.rain @p ~~~ 1 5"
          ]
        }
      },

      "suspraize:toggle_north": {
        "set_block_property": {
          "suspraize:active_north": "query.block_property('suspraize:active_north') ? false : true"
        }
      },
      "suspraize:toggle_south": {
        "set_block_property": {
          "suspraize:active_south": "query.block_property('suspraize:active_south') ? false : true"
        }
      },

      "suspraize:toggle_west": {
        "set_block_property": {
          "suspraize:active_west": "query.block_property('suspraize:active_west') ? false : true"
        }
      },
      "suspraize:toggle_east": {
        "set_block_property": {
          "suspraize:active_east": "query.block_property('suspraize:active_east') ? false : true"
        }
      },

      "loled:place": {
        "set_block_property": {
          "loled:face": "(query.cardinal_player_facing)"
        }
      }
    },

    "permutations": [
      {
        "condition": "query.block_property('suspraize:active_north')",
        "components": {
          "minecraft:ticking": {
            "looping": true,
            "range": [ 0, 0 ],
            "on_tick": {
              "event": "particle_north"
            }
          }
        }
      },
      {
        "condition": "query.block_property('suspraize:active_south')",
        "components": {
          "minecraft:ticking": {
            "looping": true,
            "range": [ 0, 0 ],
            "on_tick": {
              "event": "particle_south"
            }
          }
        }
      },
      {
        "condition": "query.block_property('suspraize:active_west')",
        "components": {
          "minecraft:ticking": {
            "looping": true,
            "range": [ 0, 0 ],
            "on_tick": {
              "event": "particle_west"
            }
          }
        }
      },
      {
        "condition": "query.block_property('suspraize:active_east')",
        "components": {
          "minecraft:ticking": {
            "looping": true,
            "range": [ 0, 0 ],
            "on_tick": {
              "event": "particle_east"
            }
          }
        }
      },

      {
        "condition": "query.block_property('loled:face') == 2",  //Norte↑

        "components": {
          "minecraft:rotation": [ 0, 0, 0 ],
          "minecraft:on_interact": {
            "event": "suspraize:toggle_north"
          }
        }
      },
      {
        "condition": "query.block_property('loled:face') == 3", //Sul↓
        "components": {
          "minecraft:rotation": [ 0, 180, 0 ],
          "minecraft:on_interact": {
            "event": "suspraize:toggle_south"
          }
        }
      },
      {
        "condition": "query.block_property('loled:face') == 4", //Oeste ←
        "components": {
          "minecraft:rotation": [ 0, 90, 0 ],
          "minecraft:on_interact": {
            "event": "suspraize:toggle_west"
          }
        }
      },
      {
        "condition": "query.block_property('loled:face') == 5", //Leste→
        "components": {
          "minecraft:rotation": [ 0, 270, 0 ],
          "minecraft:on_interact": {
            "event": "suspraize:toggle_east"
          }
        }
      }
    ]
  }
}
