ServerEvents.recipes(event => {
	const removeRecipes = [
		/tfc:crafting\/food\/.*sandwich/,
		/firmalife:crafting\/food\/.*sandwich/
	]
	removeRecipes.forEach(id => {
		event.remove({id:id})
	})
	
	//"firmalife:food/barley_flatbread"
	//"firmalife:food/barley_slice"
	//"tfc:food/rice_bread"
	
	const grains=['rice','wheat','oat','barley','rye','maize'];
	const base1=["firmalife:food/","firmalife:food/","tfc:food/"];
	const base2=["_flatbread","_slice","_bread"];
	
	for(let j=0;j<3;j++){
	for(let i=0;i<6;i++){
	event.custom({
		"type":"tfc:advanced_shaped_crafting",
		"key":{
			"B":{
				"type":"tfc:and",
				"children":[
					{"item":base1[j]+grains[i]+base2[j]},
					{"type":"tfc:not_rotten"}
				]
			},
			"J":{
				"type":"tfc:and",
				"children":[
					{"tag":"tfc:foods/jam"},
					{"type":"tfc:not_rotten"}
				]
			},
			"K":{"tag":"c:tools/knife"},
			"S":{
				"type":"tfc:and",
				"children":[
					{"tag":"tfc:usable_in_jam_sandwich"},
					{"type":"tfc:not_rotten"}
				]
			}
		},
		"pattern":[
			"KB ",
			"JSS",
			" B "
		],
		"remainder":{"modifiers":[{"type":"tfc:damage_crafting_remainder"}]},
		"result":{
			"modifiers":[{
				"type":"tfc:meal",
				"food":{
					"decay_modifier":4.5,
					"hunger":4,
					"saturation":1.0,
					"water":0.5
				},
				"portions":[
					{
						"ingredient":{"item":base1[j]+grains[i]+base2[j]},
						"nutrient_modifier":0.675,
						"saturation_modifier":0.5,
						"water_modifier":0.5
					},
					{
						"nutrient_modifier":0.8,
						"saturation_modifier":0.8,
						"water_modifier":0.8
					}
				]
			}],
			"stack":{"count":2,"id":"tfc:food/"+grains[i]+"_bread_jam_sandwich"}
		}
	})

	event.custom({
		"type":"tfc:advanced_shaped_crafting",
		"key":{
			"B":{
				"type":"tfc:and",
				"children":[
					{"item":base1[j]+grains[i]+base2[j]},
					{"type":"tfc:not_rotten"}
				]
			},
			"K":{"tag":"c:tools/knife"},
			"S":{
				"type":"tfc:and",
				"children":[
					{"tag":"tfc:usable_in_sandwich"},
					{"type":"tfc:not_rotten"}
				]
			}
		},
		"pattern":[
			"KB ",
			"SSS",
			" B "
		],
		"remainder":{"modifiers":[{"type":"tfc:damage_crafting_remainder"}]},
		"result":{
			"modifiers":[{
				"type":"tfc:meal",
				"food":{
					"decay_modifier":4.5,
					"hunger":4,
					"saturation":1.0,
					"water":0.5
				},
				"portions":[
					{
						"ingredient":{"item":base1[j]+grains[i]+base2[j]},
						"nutrient_modifier":0.675,
						"saturation_modifier":0.5,
						"water_modifier":0.5
					},
					{
						"nutrient_modifier":0.8,
						"saturation_modifier":0.8,
						"water_modifier":0.8
					}
				]
			}],
			"stack":{"count":2,"id":"tfc:food/"+grains[i]+"_bread_sandwich"}
		}
	})
	
	}
	}

})



/*

{
	"type":"tfc:advanced_shaped_crafting",
	"key":{
		"B":{
			"type":"tfc:and",
			"children":[
				{"item":"tfc:food/barley_bread"},
				{"type":"tfc:not_rotten"}
			]
		},
		"J":{
			"type":"tfc:and",
			"children":[
				{"tag":"tfc:foods/jam"},
				{"type":"tfc:not_rotten"}
			]
		},
		"K":{"tag":"c:tools/knife"},
		"S":{
			"type":"tfc:and",
			"children":[
				{"tag":"tfc:usable_in_jam_sandwich"},
				{"type":"tfc:not_rotten"}
			]
		}
	},
	"pattern":[
		"KB ",
		"JSS",
		" B "
	],
	"remainder":{"modifiers":[{"type":"tfc:damage_crafting_remainder"}]},
	"result":{
		"modifiers":[{
			"type":"tfc:meal",
			"food":{
				"decay_modifier":4.5,
				"hunger":4,
				"saturation":1.0,
				"water":0.5
			},
			"portions":[
				{
					"ingredient":{"item":"tfc:food/barley_bread"},
					"nutrient_modifier":0.675,
					"saturation_modifier":0.5,
					"water_modifier":0.5
				},
				{
					"nutrient_modifier":0.8,
					"saturation_modifier":0.8,
					"water_modifier":0.8
				}
			]
		}],
		"stack":{"count":1,"id":"tfc:food/barley_bread_jam_sandwich"}
	}
}

*/