You would need to listen to BiomeLoadingEvent (), you could register an function to it like this:
MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, onBiomeLoading);
As from the javadocs of the event: "This event fires when a Biome is created from json or when a registered biome is re-created for worldgen"
With this done you would just need to "treat" the biome in the listener and add any feature (like ore generation) you need.
An exemple of listener:
public static void onBiomeLoading(final BiomeLoadingEvent event) {
/* Check which biome are being loaded, example: if the biome is TAIGA or SWAMP */
if (event.getCategory() == Biome.Category.TAIGA || event.getCategory() == Biome.Category.SWAMP) {
/* Get UNDERGROUND_ORES features of the biome */
event.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES ).add(
/* adding COAL_ORE with some configuration */
() -> Blocks.COAL_ORE.withConfiguration(...)
);
}
}
As from the configuration you could look at the Vanilla default ore generation features to get what you want.