{
	"format_version": "1.16.100",
	"minecraft:block": {
		"description": {
			"identifier": "medieval:stripped_birch_box",
			"properties": {
				"medieval:facing_direction": [0,1,2,3,4,5],
				"medieval:food": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],
				"medieval:food_2": [0,1,2,3,4,5,6,7]
			}
		},
		"permutations": [
			{
				"condition": "query.block_property('medieval:facing_direction') == 2",
				"components": {
					"minecraft:rotation": [0,0,0]
				}
			},
			{
				"condition": "query.block_property('medieval:facing_direction') == 3",
				"components": {
					"minecraft:rotation": [0,180,0]
				}
			},
			{
				"condition": "query.block_property('medieval:facing_direction') == 4",
				"components": {
					"minecraft:rotation": [0,90,0]
				}
			},
			{
				"condition": "query.block_property('medieval:facing_direction') == 5",
				"components": {
					"minecraft:rotation": [0,-90,0]
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 0",
				"components": {
					"minecraft:geometry": "geometry.box_close"
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 1",
				"components": {
					"minecraft:geometry": "geometry.box_open",
					"minecraft:entity_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:pick_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:on_interact": { "event": "close" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 2",
				"components": {
					"minecraft:geometry": "geometry.box_apple_close",
					"minecraft:material_instances": {
						"apple": {
							"texture": "apple_food",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "open" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 3",
				"components": {
					"minecraft:geometry": "geometry.box_apple_open",
					"minecraft:entity_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:pick_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:material_instances": {
						"apple": {
							"texture": "apple_food",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "close2" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 4",
				"components": {
					"minecraft:geometry": "geometry.box_beetroot_close",
					"minecraft:material_instances": {
						"beetroot": {
							"texture": "beetroot_food",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"leaf": {
							"texture": "beetroot_leaf",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "open" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 5",
				"components": {
					"minecraft:geometry": "geometry.box_beetroot_open",
					"minecraft:entity_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:pick_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:material_instances": {
						"beetroot": {
							"texture": "beetroot_food",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"leaf": {
							"texture": "beetroot_leaf",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "close2" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 6",
				"components": {
					"minecraft:geometry": "geometry.box_carrot_close",
					"minecraft:material_instances": {
						"carrot": {
							"texture": "carrot_food",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"carrot_leaf": {
							"texture": "carrot_leaf",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "open" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 7",
				"components": {
					"minecraft:geometry": "geometry.box_carrot_open",
					"minecraft:entity_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:pick_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:material_instances": {
						"carrot": {
							"texture": "carrot_food",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"carrot_leaf": {
							"texture": "carrot_leaf",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "close2" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 8",
				"components": {
					"minecraft:geometry": "geometry.box_bamboo_close",
					"minecraft:material_instances": {
						"bamboo": {
							"texture": "bamboo_food",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "open" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 9",
				"components": {
					"minecraft:geometry": "geometry.box_bamboo_open",
					"minecraft:entity_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:pick_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:material_instances": {
						"bamboo": {
							"texture": "bamboo_food",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "close2" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 10",
				"components": {
					"minecraft:geometry": "geometry.box_potato_close",
					"minecraft:material_instances": {
						"potato": {
							"texture": "potato_food",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "open" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 11",
				"components": {
					"minecraft:geometry": "geometry.box_potato_open",
					"minecraft:entity_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:pick_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:material_instances": {
						"potato": {
							"texture": "potato_food",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "close2" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 12",
				"components": {
					"minecraft:geometry": "geometry.box_apple_close",
					"minecraft:material_instances": {
						"apple": {
							"texture": "golden_apple_food",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "open" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 13",
				"components": {
					"minecraft:geometry": "geometry.box_apple_open",
					"minecraft:entity_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:pick_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:material_instances": {
						"apple": {
							"texture": "golden_apple_food",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "opaque",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "close2" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 14",
				"components": {
					"minecraft:geometry": "geometry.box_carrot_close",
					"minecraft:material_instances": {
						"carrot": {
							"texture": "golden_carrot_food",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"carrot_leaf": {
							"texture": "golden_carrot_leaf",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "open" }
				}
			},
			{
				"condition": "query.block_property('medieval:food') == 15",
				"components": {
					"minecraft:geometry": "geometry.box_carrot_open",
					"minecraft:entity_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:pick_collision": {
						"origin": [-8.0, 0.0, -8.0],
						"size": [16, 11, 16]
					},
					"minecraft:material_instances": {
						"carrot": {
							"texture": "golden_carrot_food",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"carrot_leaf": {
							"texture": "golden_carrot_leaf",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						},
						"wood": {
							"texture": "stripped_birch",
							"render_method": "alpha_test",
							"ambient_occlusion": true,
							"face_dimming": true
						}
					},
					"minecraft:on_interact": { "event": "close2" }
				}
			}
		],
		"components": {
			"minecraft:geometry": "geometry.box_close",
			"minecraft:material_instances": {
				"*": {
				"texture": "stripped_birch",
				"render_method": "opaque"
				}
			},
			"minecraft:on_player_placing": {
				"event": "set_facing_direction"
			},
			"minecraft:creative_category": {
				"category": "items",
				"group": "itemGroup.name.chest"
			},
			"minecraft:on_interact": {
				"event": "open"
			},
			"minecraft:entity_collision": {
				"origin": [-8.0, 0.0, -8.0],
				"size": [16, 16, 16]
			},
			"minecraft:pick_collision": {
				"origin": [-8.0, 0.0, -8.0],
				"size": [16, 16, 16]
			},
			"minecraft:flammable": {
				"flame_odds": 5,
				"burn_odds": 5
			},
			"minecraft:block_light_absorption": 0.0,
			"minecraft:explosion_resistance": 1.8,
			"minecraft:map_color": "#f7781e",
			"minecraft:destroy_time": 1
		},
		"events": {
			"close": {
				"sequence": [
					{
						"condition": "query.block_property('medieval:food') == 1 && query.get_equipped_item_name('main_hand') == 'apple'",
						"set_block_property": {
							"medieval:food": 3
						},
						"run_command": {
							"command": "playsound block.itemframe.add_item @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 1 && query.get_equipped_item_name('main_hand') == 'beetroot'",
						"set_block_property": {
							"medieval:food": 5
						},
						"run_command": {
							"command": "playsound block.itemframe.add_item @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 1 && query.get_equipped_item_name('main_hand') == 'carrot'",
						"set_block_property": {
							"medieval:food": 7
						},
						"run_command": {
							"command": "playsound block.itemframe.add_item @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 1 && query.get_equipped_item_name('main_hand') == 'bamboo'",
						"set_block_property": {
							"medieval:food": 9
						},
						"run_command": {
							"command": "playsound block.itemframe.add_item @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 1 && query.get_equipped_item_name('main_hand') == 'potato'",
						"set_block_property": {
							"medieval:food": 11
						},
						"run_command": {
							"command": "playsound block.itemframe.add_item @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 1 && query.get_equipped_item_name('main_hand') == 'golden_apple'",
						"set_block_property": {
							"medieval:food": 13
						},
						"run_command": {
							"command": "playsound block.itemframe.add_item @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 1 && query.get_equipped_item_name('main_hand') == 'golden_carrot'",
						"set_block_property": {
							"medieval:food": 15
						},
						"run_command": {
							"command": "playsound block.itemframe.add_item @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 1 && query.get_equipped_item_name('main_hand') == ''",
						"set_block_property": {
							"medieval:food": 0
						},
						"run_command": {
							"command": "playsound block.barrel.close @p ~ ~ ~"
						}
					}
				]
			},
			"close2": {
				"sequence": [
					{
						"condition": "query.block_property('medieval:food') == 3",
						"set_block_property": {
							"medieval:food": 2
						},
						"run_command": {
							"command": "playsound block.barrel.close @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 5",
						"set_block_property": {
							"medieval:food": 4
						},
						"run_command": {
							"command": "playsound block.barrel.close @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 7",
						"set_block_property": {
							"medieval:food": 6
						},
						"run_command": {
							"command": "playsound block.barrel.close @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 9",
						"set_block_property": {
							"medieval:food": 8
						},
						"run_command": {
							"command": "playsound block.barrel.close @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 11",
						"set_block_property": {
							"medieval:food": 10
						},
						"run_command": {
							"command": "playsound block.barrel.close @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 13",
						"set_block_property": {
							"medieval:food": 12
						},
						"run_command": {
							"command": "playsound block.barrel.close @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 15",
						"set_block_property": {
							"medieval:food": 14
						},
						"run_command": {
							"command": "playsound block.barrel.close @p ~ ~ ~"
						}
					},
					{
						"condition": "query.get_equipped_item_name('main_hand') == 'wooden_shovel'",
						"set_block_property": {
							"medieval:food": 1
						},
						"run_command": {
							"command": "playsound block.itemframe.remove_item @p ~ ~ ~"
						}
					}
				]
			},
			"open": {
				"sequence": [
					{
						"condition": "query.block_property('medieval:food') == 0",
						"set_block_property": {
								"medieval:food": 1
						},
						"run_command": {
								"command": "playsound block.barrel.open @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 2",
						"set_block_property": {
							"medieval:food": 3
							},
						"run_command": {
							"command": "playsound block.barrel.open @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 4",
						"set_block_property": {
							"medieval:food": 5
						},
						"run_command": {
							"command": "playsound block.barrel.open @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 6",
						"set_block_property": {
								"medieval:food": 7
						},
						"run_command": {
								"command": "playsound block.barrel.open @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 8",
						"set_block_property": {
							"medieval:food": 9
							},
						"run_command": {
							"command": "playsound block.barrel.open @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 10",
						"set_block_property": {
							"medieval:food": 11
						},
						"run_command": {
							"command": "playsound block.barrel.open @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 12",
						"set_block_property": {
							"medieval:food": 13
							},
						"run_command": {
							"command": "playsound block.barrel.open @p ~ ~ ~"
						}
					},
					{
						"condition": "query.block_property('medieval:food') == 14",
						"set_block_property": {
							"medieval:food": 15
						},
						"run_command": {
							"command": "playsound block.barrel.open @p ~ ~ ~"
						}
					}
				]
			},
			"set_facing_direction": {
				"set_block_property": {
					"medieval:facing_direction": "query.cardinal_facing_2d"
				}
	  		}
		}
  	}
}