const chestReplacementMap = {
  "caverns_and_chasms:silver_ingot":    "oreganized:silver_nugget",
  "caverns_and_chasms:silver_nugget":   "oreganized:silver_nugget",
  "caverns_and_chasms:silver_block":    "oreganized:silver_ingot",
  "caverns_and_chasms:tin_ingot":       "create_ironworks:tin_nugget",
  "caverns_and_chasms:tin_nugget":      "create_ironworks:tin_nugget",
  "caverns_and_chasms:tin_block":       "create_ironworks:tin_ingot",
  "minecraft:gold_ingot":               "minecraft:gold_nugget",
  "minecraft:diamond":                  "minecraft:copper_nugget",
  "minecraft:diamond_pickaxe":          "minecraft:diamond",
  "minecraft:diamond_axe":              "minecraft:diamond",
  "minecraft:diamond_sword":            "minecraft:diamond",
  "minecraft:diamond_chestplate":       "minecraft:diamond",
  "minecraft:diamond_leggings":         "minecraft:diamond",
  "minecraft:diamond_boots":            "minecraft:diamond",
  "minecraft:diamond_hoe":              "minecraft:diamond",
  "alexscaves:diving_helmet":           "create:copper_diving_helmet",
  "create:crushed_raw_gold":            "createmetallurgy:gold_dust",
  "create:crushed_raw_iron":            "createmetallurgy:iron_dust",
  "create:crushed_raw_zinc":            "createmetallurgy:zinc_dust",
  "create:crushed_raw_copper":          "createmetallurgy:copper_dust",
}


LootJS.modifiers(event => {
    event
        .addLootTypeModifier([LootType.CHEST, LootType.UNKNOWN, LootType.FISHING, LootType.PIGLIN_BARTER, LootType.ADVANCEMENT_REWARD, LootType.GIFT])
        .anyDimension(["minecraft:overworld"])
        .modifyLoot(Ingredient.of(Object.keys(chestReplacementMap)), (/** @type {Internal.ItemStack} */ item) =>
        Item.of(chestReplacementMap[item.item.id], item.count)
    )
})