{
	"format_version": "1.20.30",
	"minecraft:block": {
		"description": {
			"identifier": "farmersdelight:rice_roll_medley_block",
			"states": {
				"block:slice": [
					8,
					7,
					6,
					5,
					4,
					3,
					2,
					1,
					0
				],
				"block:rotation": [
					2,
					3,
					4,
					5
				]
			}
		},
		"components": {
			"minecraft:material_instances": {
				"*": {
					"render_method": "alpha_test",
					"texture": "rice_roll_medley_block"
				}
			},
			"minecraft:destructible_by_mining": {
				"seconds_to_destroy": 0.5
			},
			"minecraft:on_interact": {
				"event": "slice"
			},
			"minecraft:collision_box": {
				"origin": [
					-6,
					0,
					-6
				],
				"size": [
					12,
					4,
					12
				]
			},
			"minecraft:selection_box": {
				"origin": [
					-6,
					0,
					-6
				],
				"size": [
					12,
					4,
					12
				]
			},
			"minecraft:on_player_placing": {
				"event": "block:rotation"
			},
			"minecraft:loot": "loot_tables/empty.json"
		},
		"events": {
			"slice": {
				"sequence": [
					{
						"set_block_state": {
							"block:slice": "query.block_state('block:slice') - 1"
						}
					},
					{
						"sequence": [
							{
								"condition": "query.block_state('block:slice')==6||query.block_state('block:slice')==7||query.block_state('block:slice')==8",
								"run_command": {
									"command": [
										"loot spawn ~ ~ ~ loot kelp_roll_slice",
										"playsound armor.equip_generic @a[r=6]"
									],
									"target": "other"
								}
							},
							{
								"condition": "query.block_state('block:slice')==3||query.block_state('block:slice')==4||query.block_state('block:slice')==5",
								"run_command": {
									"command": [
										"playsound armor.equip_generic @a[r=6]",
										"loot spawn ~ ~ ~ loot salmon_roll"
									],
									"target": "other"
								}
							},
							{
								"condition": "query.block_state('block:slice')==1||query.block_state('block:slice')==2",
								"run_command": {
									"command": [
										"playsound armor.equip_generic @a[r=6]",
										"loot spawn ~ ~ ~ loot cod_roll"
									],
									"target": "other"
								}
							},
							{
								"condition": "query.block_state('block:slice')==0",
								"spawn_loot": {
									"table": "loot_tables/rice_roll_medley.json"
								},
								"run_command": {
									"command": [
										"playsound use.cloth @a[r=6]"
									],
									"target": "other"
								}
							}
						]
					},
					{
						"condition": "query.block_state('block:slice')==0",
						"set_block": {
							"block_type": "minecraft:air"
						}
					}
				]
			},
			"block:rotation": {
				"set_block_state": {
					"block:rotation": "query.cardinal_facing_2d",
					"block:slice": 8
				}
			}
		},
		"permutations": [
			{
				"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
						]
					}
				}
			},
			{
				"condition": "query.block_state('block:slice') == 8",
				"components": {
					"minecraft:geometry": "geometry.rice_roll_medley_stage8"
				}
			},
			{
				"condition": "query.block_state('block:slice') == 7",
				"components": {
					"minecraft:geometry": "geometry.rice_roll_medley_stage7"
				}
			},
			{
				"condition": "query.block_state('block:slice') == 6",
				"components": {
					"minecraft:geometry": "geometry.rice_roll_medley_stage6"
				}
			},
			{
				"condition": "query.block_state('block:slice') == 5",
				"components": {
					"minecraft:geometry": "geometry.rice_roll_medley_stage5"
				}
			},
			{
				"condition": "query.block_state('block:slice') == 4",
				"components": {
					"minecraft:geometry": "geometry.rice_roll_medley_stage4"
				}
			},
			{
				"condition": "query.block_state('block:slice') == 3",
				"components": {
					"minecraft:geometry": "geometry.rice_roll_medley_stage3"
				}
			},
			{
				"condition": "query.block_state('block:slice') == 2",
				"components": {
					"minecraft:geometry": "geometry.rice_roll_medley_stage2"
				}
			},
			{
				"condition": "query.block_state('block:slice') == 1",
				"components": {
					"minecraft:geometry": "geometry.rice_roll_medley_stage1"
				}
			},
			{
				"condition": "query.block_state('block:slice') == 0",
				"components": {
					"minecraft:geometry": "geometry.rice_roll_medley_stage0"
				}
			}
		]
	}
}