Structure that needs a mod doesn't load if the mod is not there

So i expect the datapack to "break" if there is a structure which requires a mod and the mod is not installed in the user's game. But how to make it so if the mod is not installed the datapack ignores that structure so the game doesnt break
Continue to help post