{
    "format_version": "1.16.100",
    "minecraft:block": {
        "description": {
            "identifier": "loled:bathroom_sink",
            "properties": {
                "loled:face": [ 0, 1, 2, 3 ],
                "loled:active": [ false, true ]
            }
        },
        "components": {
            "minecraft:material_instances": {
                "*": {
                    "texture": "sink_bathroom",
                    "render_method": "opaque"
                }
            },
            "minecraft:pick_collision": {
                "origin": [ -7, 0, -8 ],
                "size": [ 14, 16, 16 ]
            },
			"minecraft:creative_category": {
              "group": "itemGroup.name.bathroom",
              "category": "construction"
            },
            "minecraft:loot": "loot_tables/bathroom/bathroom_sink.json",
            "minecraft:geometry": "geometry.sink_bathroom",
            "minecraft:destroy_time": 2.0,
			"minecraft:block_light_absorption": 0.0,
            "minecraft:unwalkable": true,
            "minecraft:entity_collision": {
                "origin": [ -7, 0, -8 ],
                "size": [ 14, 16, 16 ]
            },
            "minecraft:ticking": {
                "looping": true,
                "range": [ 0, 0 ],
                "on_tick": {
                "event": "water_particle"
                }
            },
            "minecraft:friction": 0.6,
            "minecraft:map_color": "#00ff00",
            "minecraft:flammable": {
                "flame_odds": 0,
                "burn_odds": 0
            },

            "minecraft:on_interact": { 
			"event": "loled:toggle"
			},
            "minecraft:on_player_placing": { "event": "loled:face" }
        },
        "permutations": [
            {
                "condition": "query.block_property('loled:face') == 0",
                "components": { "minecraft:rotation": [ 0, 180, 0 ] }
            }, {
                "condition": "query.block_property('loled:face') == 1",
                "components": { "minecraft:rotation": [ 0, 0, 0 ] }
            }, {
                "condition": "query.block_property('loled:face') == 2",
                "components": { "minecraft:rotation": [ 0, 270, 0 ] }
            },  {
                "condition": "query.block_property('loled:face') == 3",
                "components": { "minecraft:rotation": [ 0, 90, 0 ] }
            },
            {
                "condition": "!query.block_property('loled:active')",
                "components": {
                    "minecraft:geometry": "geometry.sink_bathroom_close",
                    "minecraft:ticking": {
                      "looping": true,
                      "range": [ 0, 0 ],
                      "on_tick": {
                      "event": "nothing"
                        }
                    },
			        "minecraft:block_light_absorption": 0.0,
                    "minecraft:material_instances": {
                        "*": {
                            "texture": "sink_bathroom_close",
                            "render_method": "opaque"
					    }
				    }
				}
            }
        ],
        "events": {
            "loled:face": {
                "set_block_property": {
                    "loled:face": "query.cardinal_facing_2d-2"
                }
            },
            "water_particle": {
                "run_command": {
                    "command": ["particle minecraft:rain_splash_particle ~~0.3~","particle minecraft:rain_splash_particle ~0.1~0.3~","particle minecraft:rain_splash_particle ~-0.1~0.3~", "playsound ambient.weather.rain @p ~~~ 1 5" ]
                }
            },
            "loled:toggle": {
                "set_block_property": {
                    "loled:active": "query.block_property('loled:active') ? false : true"
                }
            }
        }
    }
}
