onEvent('block.loot_tables', event => {
	event.addBlock('create:copper_ore', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('survivalist:copper_ore_rock', 1, [2,6])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('create:copper_ore')
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 1
					}]
				}
			})
			pool.addItem('survivalist:copper_ore_rock', 1, [0,2])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 2
					}]
				}
			})
			pool.addItem('survivalist:copper_ore_rock', 1, [0,4])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 3
					}]
				}
			})
			pool.addItem('survivalist:copper_ore_rock', 1, [0,6])
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('create:zinc_ore', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:zinc_ore_rock', 1, [2,6])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('create:zinc_ore')
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 1
					}]
				}
			})
			pool.addItem('kubejs:zinc_ore_rock', 1, [0,2])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 2
					}]
				}
			})
			pool.addItem('kubejs:zinc_ore_rock', 1, [0,4])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 3
					}]
				}
			})
			pool.addItem('kubejs:zinc_ore_rock', 1, [0,6])
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:gold_ore', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('survivalist:gold_ore_rock', 1, [2,6])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:gold_ore')
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 1
					}]
				}
			})
			pool.addItem('survivalist:gold_ore_rock', 1, [0,2])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 2
					}]
				}
			})
			pool.addItem('survivalist:gold_ore_rock', 1, [0,4])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 3
					}]
				}
			})
			pool.addItem('survivalist:gold_ore_rock', 1, [0,6])
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:nether_gold_ore', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('minecraft:gold_nugget', 1, [2,4])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('natural-progression:netherrack_pebble', 1, [1,5])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:nether_gold_ore')
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 1
					}]
				}
			})
			pool.addItem('minecraft:gold_nugget', 1, [0,2])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 2
					}]
				}
			})
			pool.addItem('minecraft:gold_nugget', 1, [0,3])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 3
					}]
				}
			})
			pool.addItem('minecraft:gold_nugget', 1, [0,4])
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:quartz_ore', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('minecraft:quartz', 1, 1)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('natural-progression:netherrack_pebble', 1, [3,5])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:quartz_ore')
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 1
					}]
				}
			})
			pool.addItem('minecraft:quartz', 1, [0,1])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 2
					}]
				}
			})
			pool.addItem('minecraft:quartz', 1, [0,2])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 3
					}]
				}
			})
			pool.addItem('minecraft:quartz', 1, [0,3])
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:iron_ore', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('survivalist:iron_ore_rock', 1, [2,6])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:iron_ore')
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 1
					}]
				}
			})
			pool.addItem('survivalist:iron_ore_rock', 1, [0,2])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 2
					}]
				}
			})
			pool.addItem('survivalist:iron_ore_rock', 1, [0,4])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 3
					}]
				}
			})
			pool.addItem('survivalist:iron_ore_rock', 1, [0,6])
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('minecraft:gilded_blackstone', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:blackstone_pebble', 1, [4,6])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('minecraft:gold_nugget', 1, [1,3])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('minecraft:gilded_blackstone')
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 1
					}]
				}
			})
			pool.addItem('minecraft:gold_nugget', 1, [0,1])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 2
					}]
				}
			})
			pool.addItem('minecraft:gold_nugget', 1, [0,2])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 3
					}]
				}
			})
			pool.addItem('minecraft:gold_nugget', 1, [0,3])
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('endrem:end_crystal_ore', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('kubejs:blackstone_pebble', 1, [3,5])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('endrem:end_crystal', 1, 1)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('endrem:end_crystal_ore')
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 1
					}]
				}
			})
			pool.addItem('endrem:end_crystal', 1, [0,1])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 2
					}]
				}
			})
			pool.addItem('endrem:end_crystal', 1, [0,2])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 3
					}]
				}
			})
			pool.addItem('endrem:end_crystal', 1, [0,3])
		})
	})
})

onEvent('block.loot_tables', event => {
	event.addBlock('quark:biotite_ore', table => {
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('natural-progression:end_stone_pebble', 1, [3,5])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:inverted",
				term: {
					condition: "minecraft:match_tool",
					predicate: {
						enchantments: [{
							enchantment: "minecraft:silk_touch",
							levels: 1
						}]
					}
				}
			})
			pool.addItem('quark:biotite', 1, 1)
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:silk_touch",
						levels: 1
					}]
				}
			})
			pool.rolls = 1;
			pool.addItem('quark:biotite_ore')
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 1
					}]
				}
			})
			pool.addItem('quark:biotite', 1, [0,1])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 2
					}]
				}
			})
			pool.addItem('quark:biotite', 1, [0,2])
		})
		table.addPool(pool => {
			pool.addCondition({
				condition: "minecraft:match_tool",
				predicate: {
					enchantments: [{
						enchantment: "minecraft:fortune",
						levels: 3
					}]
				}
			})
			pool.addItem('quark:biotite', 1, [0,3])
		})
	})
})

onEvent('recipes', event => {
	event.remove({id:'survivalist:smelting/iron_ore_rock'})
	event.remove({id:'survivalist:smelting/iron_ore_rock_from_blasting'})
	event.remove({id:'survivalist:smelting/gold_ore_rock'})
	event.remove({id:'survivalist:smelting/gold_ore_rock_from_blasting'})
	event.remove({id:'survivalist:smelting/copper_ore_rock'})
	event.remove({id:'survivalist:smelting/copper_ore_rock_from_blasting'})
	
	
	event.smelting('create:zinc_nugget', 'kubejs:zinc_ore_rock')
	event.blasting('create:zinc_nugget', 'kubejs:zinc_ore_rock')
	event.smelting('minecraft:iron_nugget', 'survivalist:iron_ore_rock')
	event.blasting('minecraft:iron_nugget', 'survivalist:iron_ore_rock')
	event.smelting('minecraft:gold_nugget', 'survivalist:gold_ore_rock')
	event.blasting('minecraft:gold_nugget', 'survivalist:gold_ore_rock')
	event.smelting('create:copper_nugget', 'survivalist:copper_ore_rock')
	event.blasting('create:copper_nugget', 'survivalist:copper_ore_rock')
})

onEvent('recipes', event => {
	event.remove({type:'minecraft:smelting', input:'#forge:ores'})
	event.remove({type:'minecraft:blasting', input:'#forge:ores'})
	
	event.remove({type:'create:crushing', input:'#forge:ores'})
	event.remove({type:'create:milling', input:'#forge:ores'})
	
	event.recipes.createCrushing(['6x survivalist:iron_ore_rock', Item.of('2x survivalist:iron_ore_rock').withChance(0.5)], '#forge:ores/iron')
	event.recipes.createCrushing(['6x survivalist:gold_ore_rock', Item.of('2x survivalist:gold_ore_rock').withChance(0.5)], '#forge:ores/gold')
	event.recipes.createCrushing(['6x survivalist:copper_ore_rock', Item.of('2x survivalist:copper_ore_rock').withChance(0.5)], '#forge:ores/copper')
	event.recipes.createCrushing(['6x kubejs:zinc_ore_rock', Item.of('2x kubejs:zinc_ore_rock').withChance(0.5)], '#forge:ores/zinc')
	event.recipes.createCrushing(['6x minecraft:lapis_lazuli', Item.of('2x minecraft:lapis_lazuli').withChance(0.5)], '#forge:ores/lapis')
	event.recipes.createCrushing(['6x minecraft:redstone', Item.of('2x minecraft:redstone').withChance(0.5)], '#forge:ores/redstone')
	event.recipes.createCrushing(['minecraft:quartz', Item.of('minecraft:quartz').withChance(0.5)], '#forge:ores/quartz')
	event.recipes.createCrushing(['minecraft:diamond', Item.of('minecraft:diamond').withChance(0.5)], '#forge:ores/diamond')
	event.recipes.createCrushing(['minecraft:emerald', Item.of('minecraft:emerald').withChance(0.5)], '#forge:ores/emerald')
	
})