const to_remove_cf = [
	'minecraft:wooden_pickaxe',
	'minecraft:wooden_sword',
	'minecraft:wooden_axe',
	'minecraft:wooden_shovel',
	'minecraft:wooden_hoe',
	'minecraft:iron_pickaxe',
	'minecraft:iron_sword',
	'minecraft:iron_axe',
	'minecraft:iron_shovel',
	'minecraft:iron_hoe',
	'minecraft:iron_chestplate',
	'minecraft:iron_helmet',
	'minecraft:iron_leggings',
	'minecraft:iron_boots',
	'minecraft:golden_pickaxe',
	'minecraft:golden_sword',
	'minecraft:golden_axe',
	'minecraft:golden_shovel',
	'minecraft:golden_hoe',
	'minecraft:golden_chestplate',
	'minecraft:golden_helmet',
	'minecraft:golden_leggings',
	'minecraft:golden_boots',
	'minecraft:diamond_pickaxe',
	'minecraft:diamond_sword',
	'minecraft:diamond_axe',
	'minecraft:diamond_shovel',
	'minecraft:diamond_hoe',
	'minecraft:diamond_chestplate',
	'minecraft:diamond_helmet',
	'minecraft:diamond_leggings',
	'minecraft:diamond_boots',
	'minecraft:netherite_pickaxe',
	'minecraft:netherite_sword',
	'minecraft:netherite_axe',
	'minecraft:netherite_shovel',
	'minecraft:netherite_hoe',
	'minecraft:netherite_chestplate',
	'minecraft:netherite_helmet',
	'minecraft:netherite_leggings',
	'minecraft:netherite_boots',
	'minecraft:stone_pickaxe',
	'minecraft:stone_sword',
	'minecraft:stone_axe',
	'minecraft:stone_shovel',
	'minecraft:stone_hoe',
	'minecraft:chainmail_chestplate',
	'minecraft:chainmail_helmet',
	'minecraft:chainmail_leggings',
	'minecraft:chainmail_boots'
]

const tools = [
	'minecraft:wooden_pickaxe',
	'minecraft:wooden_sword',
	'minecraft:wooden_axe',
	'minecraft:wooden_shovel',
	'minecraft:wooden_hoe',
	'minecraft:stone_pickaxe',
	'minecraft:stone_sword',
	'minecraft:stone_axe',
	'minecraft:stone_shovel',
	'minecraft:stone_hoe',
	'minecraft:iron_pickaxe',
	'minecraft:iron_sword',
	'minecraft:iron_axe',
	'minecraft:iron_shovel',
	'minecraft:iron_hoe',
	'minecraft:golden_pickaxe',
	'minecraft:golden_sword',
	'minecraft:golden_axe',
	'minecraft:golden_shovel',
	'minecraft:golden_hoe',
	'minecraft:diamond_pickaxe',
	'minecraft:diamond_sword',
	'minecraft:diamond_axe',
	'minecraft:diamond_shovel',
	'minecraft:diamond_hoe',
	'minecraft:netherite_pickaxe',
	'minecraft:netherite_sword',
	'minecraft:netherite_axe',
	'minecraft:netherite_shovel',
	'minecraft:netherite_hoe'
]

const tools_cast_d = [
	'minecraft:diamond_pickaxe',
	'minecraft:diamond_sword',
	'minecraft:diamond_axe',
	'minecraft:diamond_shovel',
	'minecraft:diamond_hoe'
]

const tool_cast_n = [
	'minecraft:netherite_pickaxe',
	'minecraft:netherite_sword',
	'minecraft:netherite_axe',
	'minecraft:netherite_shovel',
	'minecraft:netherite_hoe'
]

const leather_armor = [
	'minecraft:leather_chestplate',
	'minecraft:leather_helmet',
	'minecraft:leather_leggings',
	'minecraft:leather_boots'
]


ServerEvents.recipes(event => {
    //const all_stones_for_lava_tags = ['#minecraft:stone_crafting_materials', '#minecraft:stone', '#minecraft:stone_bricks']
    //const all_items_to_remove_in_crafting_table = ['#minecraft:pickaxes', '#minecraft:armors', '#minecraft:axes', '#minecraft:swords', '#minecraft:shovels']
	
	for (let item of to_remove_cf)
		event.remove({output: item})


	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:wooden_pickaxe',            // Arg 2: the item to replace
		Item.of('tconstruct:pickaxe', '{tic_materials:["tconstruct:wood","tconstruct:wood","tconstruct:wood"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:wooden_sword',            // Arg 2: the item to replace
		Item.of('tconstruct:sword', '{tic_materials:["tconstruct:wood","tconstruct:wood","tconstruct:wood"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:wooden_axe',            // Arg 2: the item to replace
		Item.of('tconstruct:hand_axe', '{tic_materials:["tconstruct:wood","tconstruct:wood","tconstruct:wood"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:wooden_shovel',            // Arg 2: the item to replace
		Item.of('tconstruct:excavator', '{tic_materials:["tconstruct:wood","tconstruct:wood","tconstruct:wood"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:wooden_hoe',            // Arg 2: the item to replace
		Item.of('tconstruct:kama', '{tic_materials:["tconstruct:wood","tconstruct:wood","tconstruct:wood"]}').strongNBT()        // Arg 3: the item to replace it with
	)

	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:iron_pickaxe',            // Arg 2: the item to replace
		Item.of('tconstruct:pickaxe', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:iron_sword',            // Arg 2: the item to replace
		Item.of('tconstruct:sword', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:iron_axe',            // Arg 2: the item to replace
		Item.of('tconstruct:hand_axe', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:iron_shovel',            // Arg 2: the item to replace
		Item.of('tconstruct:excavator', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:iron_hoe',            // Arg 2: the item to replace
		Item.of('tconstruct:kama', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()        // Arg 3: the item to replace it with
	)

	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:golden_pickaxe',            // Arg 2: the item to replace
		Item.of('tconstruct:pickaxe', '{tic_materials:["tconstruct:gold","tconstruct:wood","tconstruct:gold"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:golden_sword',            // Arg 2: the item to replace
		Item.of('tconstruct:sword', '{tic_materials:["tconstruct:gold","tconstruct:wood","tconstruct:gold"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:golden_axe',            // Arg 2: the item to replace
		Item.of('tconstruct:hand_axe', '{tic_materials:["tconstruct:gold","tconstruct:wood","tconstruct:gold"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:golden_shovel',            // Arg 2: the item to replace
		Item.of('tconstruct:excavator', '{tic_materials:["tconstruct:gold","tconstruct:wood","tconstruct:gold"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:golden_hoe',            // Arg 2: the item to replace
		Item.of('tconstruct:kama', '{tic_materials:["tconstruct:gold","tconstruct:wood","tconstruct:gold"]}').strongNBT()        // Arg 3: the item to replace it with
	)

	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:stone_pickaxe',            // Arg 2: the item to replace
		Item.of('tconstruct:pickaxe', '{tic_materials:["tconstruct:rock","tconstruct:wood","tconstruct:rock"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:stone_sword',            // Arg 2: the item to replace
		Item.of('tconstruct:sword', '{tic_materials:["tconstruct:rock","tconstruct:wood","tconstruct:rock"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:stone_axe',            // Arg 2: the item to replace
		Item.of('tconstruct:hand_axe', '{tic_materials:["tconstruct:rock","tconstruct:wood","tconstruct:rock"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:stone_shovel',            // Arg 2: the item to replace
		Item.of('tconstruct:excavator', '{tic_materials:["tconstruct:rock","tconstruct:wood","tconstruct:rock"]}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:stone_hoe',            // Arg 2: the item to replace
		Item.of('tconstruct:kama', '{tic_materials:["tconstruct:rock","tconstruct:wood","tconstruct:rock"]}').strongNBT()        // Arg 3: the item to replace it with
	)

	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:iron_helmet',            // Arg 2: the item to replace
		Item.of('tconstruct:helmet_plating', '{Material:"tconstruct:iron"}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:iron_chestplate',            // Arg 2: the item to replace
		Item.of('tconstruct:chestplate_plating', '{Material:"tconstruct:iron"}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:iron_leggings',            // Arg 2: the item to replace
		Item.of('tconstruct:leggings_plating', '{Material:"tconstruct:iron"}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:iron_boots',            // Arg 2: the item to replace
		Item.of('tconstruct:boots_plating', '{Material:"tconstruct:iron"}').strongNBT()        // Arg 3: the item to replace it with
	)

	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:golden_helmet',            // Arg 2: the item to replace
		Item.of('tconstruct:helmet_plating', '{Material:"tconstruct:gold"}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:golden_chestplate',            // Arg 2: the item to replace
		Item.of('tconstruct:chestplate_plating', '{Material:"tconstruct:gold"}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:golden_leggings',            // Arg 2: the item to replace
		Item.of('tconstruct:leggings_plating', '{Material:"tconstruct:gold"}').strongNBT()        // Arg 3: the item to replace it with
	)
	event.replaceInput(
		{}, // Arg 1: the filter
		'minecraft:golden_boots',            // Arg 2: the item to replace
		Item.of('tconstruct:boots_plating', '{Material:"tconstruct:gold"}').strongNBT()        // Arg 3: the item to replace it with
	)

	

	event.custom(
		{
			"type": "tconstruct:melting",
			"ingredient": {
			  "tag": "forge:normal_stone"
			},
			"result": {
			  "amount": 1000,
			  "fluid": "minecraft:lava"
			},
			"temperature": 800,
			"time": 45
		}
	)

	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "minecraft:diamond_helmet"
			},
			"cast_consumed": true,
			"cooling_time": 83,
  			"fluid": {
    			"amount": 100,
    			"tag": "tconstruct:molten_netherite"
  			},
			"result": "minecraft:netherite_helmet"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "minecraft:diamond_chestplate"
			},
			"cast_consumed": true,
			"cooling_time": 83,
  			"fluid": {
    			"amount": 100,
    			"tag": "tconstruct:molten_netherite"
  			},
			"result": "minecraft:netherite_chestplate"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "minecraft:diamond_leggings"
			},
			"cast_consumed": true,
			"cooling_time": 83,
  			"fluid": {
    			"amount": 100,
    			"tag": "tconstruct:molten_netherite"
  			},
			"result": "minecraft:netherite_leggings"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "minecraft:diamond_boots"
			},
			"cast_consumed": true,
			"cooling_time": 83,
  			"fluid": {
    			"amount": 100,
    			"tag": "tconstruct:molten_netherite"
  			},
			"result": "minecraft:netherite_boots"
	 	}
	)

	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "tconstruct:helmet_plating_cast"
			},
			"cooling_time": 83,
  			"fluid": {
    			"amount": 500,
    			"tag": "tconstruct:molten_diamond"
  			},
			"result": "minecraft:diamond_helmet"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "tconstruct:chestplate_plating_cast"
			},
			"cooling_time": 83,
  			"fluid": {
    			"amount": 800,
    			"tag": "tconstruct:molten_diamond"
  			},
			"result": "minecraft:diamond_chestplate"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "tconstruct:leggings_plating_cast"
			},
			"cooling_time": 83,
  			"fluid": {
    			"amount": 700,
    			"tag": "tconstruct:molten_diamond"
  			},
			"result": "minecraft:diamond_leggings"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "tconstruct:boots_plating_cast"
			},
			"cooling_time": 83,
  			"fluid": {
    			"amount": 400,
    			"tag": "tconstruct:molten_diamond"
  			},
			"result": "minecraft:diamond_boots"
	 	}
	)

	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "minecraft:iron_pickaxe"
			},
			"cast_consumed": true,
			"cooling_time": 83,
  			"fluid": {
    			"amount": 300,
    			"tag": "tconstruct:molten_diamond"
  			},
			"result": "minecraft:diamond_pickaxe"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "minecraft:iron_hoe"
			},
			"cast_consumed": true,
			"cooling_time": 83,
  			"fluid": {
    			"amount": 200,
    			"tag": "tconstruct:molten_diamond"
  			},
			"result": "minecraft:diamond_hoe"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "minecraft:iron_sword"
			},
			"cast_consumed": true,
			"cooling_time": 83,
  			"fluid": {
    			"amount": 200,
    			"tag": "tconstruct:molten_diamond"
  			},
			"result": "minecraft:diamond_sword"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "minecraft:iron_axe"
			},
			"cast_consumed": true,
			"cooling_time": 83,
  			"fluid": {
    			"amount": 300,
    			"tag": "tconstruct:molten_diamond"
  			},
			"result": "minecraft:diamond_axe"
	 	}
	)
	event.custom(
		{
			"type": "tconstruct:casting_table",
			"cast": {
		  		"item": "minecraft:iron_shovel"
			},
			"cast_consumed": true,
			"cooling_time": 83,
  			"fluid": {
    			"amount": 100,
    			"tag": "tconstruct:molten_diamond"
  			},
			"result": "minecraft:diamond_shovel"
	 	}
	)

	event.shapeless(
		'minecraft:iron_pickaxe',
		[
			Item.of('tconstruct:pickaxe', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()
		]
	)
	event.shapeless(
		'minecraft:iron_axe',
		[
			Item.of('tconstruct:hand_axe', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()
		]
	)
	event.shapeless(
		'minecraft:iron_sword',
		[
			Item.of('tconstruct:sword', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()
		]
	)
	event.shapeless(
		'minecraft:iron_hoe',
		[
			Item.of('tconstruct:kama', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()
		]
	)
	event.shapeless(
		'minecraft:iron_shovel',
		[
			Item.of('tconstruct:excavator', '{tic_materials:["tconstruct:iron","tconstruct:wood","tconstruct:iron"]}').strongNBT()
		]
	)
	/*
    all_items_to_remove_in_crafting_table.forEach((tag) => {
		event.remove({ output: tag, type: 'minecraft:crafting_table' })
    });

    all_stones_for_lava_tags.forEach((n) => {
		event.custom({
			type: 'tconstruct:melting',
			inputs: 
			[
				{ tag: n}
			],
			result: 
			{
				fluid: 'minecraft:lava', 
				amount: 1000
			},
			temperature: 750,
			time: 45
		})
    });
    */
  })