//bridge-file-version: #9
{
	"minecraft:block": {
		"description": {
			"properties": {
				"bridge:block_rotation": [
					2,
					3,
					4,
					5
				],
				"hf:active": [
					0,
					1,
					2,
					3
				]
			},
			"identifier": "hf:microwave"
		},
		"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('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.microwaveopen",
					"minecraft:on_interact": {
						"event": "cook"
					},
					"minecraft:ticking": {
						"looping": true,
						"range": [
							5,
							5
						],
						"on_tick": {
							"event": "closesound"
						}
					}
				}
			}
		],
		"components": {
			"minecraft:on_player_placing": {
				"event": "bridge:update_rotation"
			},
			"minecraft:destroy_time": 4,
			"minecraft:entity_collision": {
				"origin": [
					-8,
					1,
					-4
				],
				"size": [
					16,
					10.3,
					9
				]
			},
			"minecraft:pick_collision": {
				"origin": [
					-8,
					1,
					-4
				],
				"size": [
					16,
					10.3,
					9
				]
			},
			"minecraft:material_instances": {
				"*": {
					"texture": "microwave",
					"render_method": "alpha_test"
				}
			},
			"minecraft:geometry": "geometry.microwaveclosed",
			"minecraft:block_light_absorption": 0,
			"minecraft:on_interact": {
				"event": "opensound"
			},
			"minecraft:creative_category": {
				"group": "itemGroup.name.Items",
				"category": "Items"
			}
		},
		"events": {
			"bridge:update_rotation": {
				"set_block_property": {
					"bridge:block_rotation": "query.cardinal_facing_2d"
				}
			},
			"opensound": {
				"set_block_property": {
					"hf:active": 1
				},
				"run_command": {
					"command": [
						"playsound block.barrel.open @p ~~~ 1 1"
					]
				}
			},
			"closesound": {
				"set_block_property": {
					"hf:active": 2
				},
				"run_command": {
					"command": [
						"playsound block.barrel.close @p ~~~ 1 1"
					]
				}
			},
			"cook": {
				"sequence": [
					{
						"spawn_loot": {
							"table": "loot_tables/entities/beef.json"
						}
					},
					{
						"spawn_loot": {
							"table": "loot_tables/entities/salmon.json"
						}
					},
					{
						"spawn_loot": {
							"table": "loot_tables/entities/cookedrabbit.json"
						}
					},
					{
						"spawn_loot": {
							"table": "loot_tables/entities/porkchop.json"
						}
					},
					{
						"spawn_loot": {
							"table": "loot_tables/entities/mutton.json"
						}
					},
					{
						"spawn_loot": {
							"table": "loot_tables/entities/cookedchicken.json"
						}
					},
					{
						"spawn_loot": {
							"table": "loot_tables/entities/cookedfish.json"
						}
					}
				]
			}
		}
	},
	"format_version": "1.17.0"
}