//bridge-file-version: #14
{
	"minecraft:block": {
		"description": {
			"properties": {
				"bridge:block_rotation": [
					2,
					3,
					4,
					5
				],
				"hf:active": [
					0,
					1,
					2
				]
			},
			"identifier": "hf:showerhead"
		},
		"permutations": [
			{
				"condition": "query.block_property('bridge:block_rotation') == 2",
				"components": {
					"minecraft:rotation": [
						0,
						180,
						0
					]
				}
			},
			{
				"condition": "query.block_property('bridge:block_rotation') == 3",
				"components": {
					"minecraft:rotation": [
						0,
						0,
						0
					]
				}
			},
			{
				"condition": "query.block_property('bridge:block_rotation') == 4",
				"components": {
					"minecraft:rotation": [
						0,
						270,
						0
					]
				}
			},
			{
				"condition": "query.block_property('bridge:block_rotation') == 5",
				"components": {
					"minecraft:rotation": [
						0,
						90,
						0
					]
				}
			},
			{
				"condition": "query.block_property('hf:active') == 1",
				"components": {
					"minecraft:geometry": "geometry.showerheadon",
					"minecraft:on_interact": {
						"event": "turnoff"
					},
					"minecraft:ticking": {
						"on_tick": {
							"event": "sound_particle"
						},
						"range": [
							0.1,
							0.1
						],
						"looping": true
					}
				}
			},
			{
				"condition": "query.block_property('hf:active') == 2",
				"components": {
					"minecraft:geometry": "geometry.showerheadoff"
				}
			}
		],
		"components": {
			"minecraft:on_player_placing": {
				"event": "bridge:update_rotation"
			},
			"minecraft:destroy_time": 4,
			"minecraft:entity_collision": {
				"origin": [
					-8,
					0,
					5
				],
				"size": [
					16,
					16,
					3
				]
			},
			"minecraft:pick_collision": {
				"origin": [
					-8,
					0,
					5
				],
				"size": [
					16,
					16,
					3
				]
			},
			"minecraft:material_instances": {
				"*": {
					"texture": "showerhead",
					"render_method": "alpha_test"
				}
			},
			"minecraft:geometry": "geometry.showerheadoff",
			"minecraft:on_interact": {
				"event": "turnon"
			},
			"minecraft:block_light_absorption": 0,
			"minecraft:creative_category": {
				"group": "itemGroup.name.Items",
				"category": "Items"
			}
		},
		"events": {
			"bridge:update_rotation": {
				"set_block_property": {
					"bridge:block_rotation": "query.cardinal_facing_2d"
				}
			},
			"turnon": {
				"set_block_property": {
					"hf:active": 1
				}
			},
			"turnoff": {
				"set_block_property": {
					"hf:active": 2
				}
			},
			"sound_particle": {
				"run_command": {
					"command": [
						"particle minecraft:water_splash_particle ~ ~1 ~",
						"playsound ambient.weather.rain @a[r=4]"
					]
				}
			}
		}
	},
	"format_version": "1.17.0"
}