External events are a feature that is work in progress. Please use with caution and expect potential issues.
This guide assumes you have some familiarity with C#, and Lethal Company modding. This guide follow's Mr. hat's template mod for an external event, but your mod can vary with structure.
Players may not have BCMER installed alongside your mod, so it is recommended to set it as a soft dependency, unless your mod requires it to be a hard dependency.
[BepInDependency("SoftDiamond.BrutalCompanyMinusExtraReborn", BepInDependency.DependencyFlags.SoftDependency)]
It is highly recommended to check if Brutal is present before running any code related to Brutal. It is recommended to do this in your main plugin class.
internal static bool hasBCMER = Chainloader.PluginInfos.ContainsKey("SoftDiamond.BrutalCompanyMinusExtraReborn");
private void Awake()
{
if (hasBCMER)
{
BCMERCompatibility.RegisterEvents();
}
}