//bridge-file-version: #22
{
	"minecraft:block": {
		"description": {
			"properties": {
				"bridge:block_rotation": [
					2,
					3,
					4,
					5
				]
			},
			"identifier": "hf:bathtub_a"
		},
		"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
					]
				}
			}
		],
		"components": {
			"minecraft:on_player_placing": {
				"event": "bridge:update_rotation"
			},
			"minecraft:destroy_time": 4,
			"minecraft:entity_collision": {
				"origin": [
					-8,
					0,
					-8
				],
				"size": [
					16,
					16,
					16
				]
			},
			"minecraft:pick_collision": {
				"origin": [
					-8,
					0,
					-8
				],
				"size": [
					16,
					16,
					16
				]
			},
			"minecraft:material_instances": {
				"*": {
					"texture": "bathtub_a",
					"render_method": "alpha_test"
				}
			},
			"minecraft:geometry": "geometry.bathtub_a",
			"minecraft:block_light_absorption": 0,
			"minecraft:creative_category": {
				"group": "itemGroup.name.Items",
				"category": "Items"
			},
			"minecraft:on_interact": {
				"event": "spawn_rideable"
			}
		},
		"events": {
			"bridge:update_rotation": {
				"set_block_property": {
					"bridge:block_rotation": "query.cardinal_facing_2d"
				}
			},
			"force_player_ride": {
				"run_command": {
					"command": [
						"ride @s start_riding @e[type=hf:sit,c=1] teleport_rider"
					],
					"target": "other"
				}
			},
			"spawn_rideable": {
				"sequence": [
					{
						"run_command": {
							"command": [
								"summon hf:sit ~ ~-0.15 ~",
								"execute @e[type=hf:sit,c=1] ~~~ tp @s ~~~ facing ~~~1"
							]
						},
						"trigger": {
							"event": "force_player_ride"
						}
					}
				]
			}
		}
	},
	"format_version": "1.17.0"
}