Mod optional dependencies

Hi ! I'm currently in the process of creating a datapack that adds structures to some mods (or datapacks for the matter) (meadow, vinery, to name a few) Is there a way to structure the files so that a structure only generate if the mod(s)/datapack(s) it uses are currently in use ?
Continue to help post