{
	"format_version": "1.20.30",
	"minecraft:block": {
		"description": {
			"identifier": "farmersdelight:stove",
			"menu_category": {
				"category": "items",
				"group": "itemGroup.name.farmersdelight_kitchen"
			},
			"states": {
				"block:lit": [
					true,
					false
				],
				"block:rotation": [
					2,
					3,
					4,
					5
				]
			}
		},
		"components": {
			"minecraft:material_instances": {
				"*": {
					"render_method": "alpha_test",
					"texture": "stove_on"
				}
			},
			"minecraft:geometry": "geometry.stove",
			"minecraft:destructible_by_mining": {
				"seconds_to_destroy": 0.5
			},
			"minecraft:on_interact": {
				"event": "check_lit",
				"condition": "query.get_equipped_item_name=='water_bucket'||query.get_equipped_item_name=='flint_and_steel'"
			},
			"minecraft:light_emission": 8,
			"minecraft:on_player_placing": {
				"event": "block:rotation"
			}
		},
		"permutations": [
			{
				"condition": "query.block_state('block:lit') == true",
				"components": {
					"minecraft:material_instances": {
						"*": {
							"render_method": "alpha_test",
							"texture": "stove_on"
						}
					},
					"tag:stove_on": {}
				}
			},
			{
				"condition": "query.block_state('block:lit') == false",
				"components": {
					"minecraft:material_instances": {
						"*": {
							"render_method": "alpha_test",
							"texture": "stove_off"
						}
					},
					"tag:stove_off": {}
				}
			},
			{
				"condition": "query.block_state('block:rotation') == 2",
				"components": {
					"minecraft:transformation": {
						"rotation": [
							0,
							0,
							0
						]
					}
				}
			},
			{
				"condition": "query.block_state('block:rotation') == 3",
				"components": {
					"minecraft:transformation": {
						"rotation": [
							0,
							-180,
							0
						]
					}
				}
			},
			{
				"condition": "query.block_state('block:rotation') == 4",
				"components": {
					"minecraft:transformation": {
						"rotation": [
							0,
							90,
							0
						]
					}
				}
			},
			{
				"condition": "query.block_state('block:rotation') == 5",
				"components": {
					"minecraft:transformation": {
						"rotation": [
							0,
							-90,
							0
						]
					}
				}
			}
		],
		"events": {
			"check_lit": {
				"sequence": [
					{
						"sequence": [
							{
								"condition": "query.block_state('block:lit')==true&&query.get_equipped_item_name=='water_bucket'",
								"set_block_state": {
									"block:lit": false
								},
								"decrement_stack": {},
								"run_command": {
									"command": [
										"give @s bucket"
									],
									"target": "other"
								}
							},
							{
								"condition": "query.block_state('block:lit')==true&&query.get_equipped_item_name=='water_bucket'",
								"run_command": {
									"command": [
										"playsound extinguish.candle @a[r=6]"
									],
									"target": "self"
								}
							}
						]
					},
					{
						"condition": "query.block_state('block:lit')==false&&query.get_equipped_item_name=='flint_and_steel'",
						"set_block_state": {
							"block:lit": true
						},
						"damage": {
							"amount": 1,
							"target": "item",
							"type": "contact"
						},
						"run_command": {
							"target": "self",
							"command": [
								"playsound fire.ignite @a[r=6]"
							]
						}
					}
				]
			},
			"block:rotation": {
				"set_block_state": {
					"block:rotation": "query.cardinal_facing_2d"
				}
			}
		}
	}
}