NoArbitraryIncompatibilityFlag
Removes incompatibility restrictions from RtD mods, allowing them to work with other popular Valheim mods.
About this mod Author’s original text
NoArbitraryIncompatibilityFlag
A BepInEx patcher that removes incompatibility restrictions from RtD mods, allowing them to work alongside other popular Valheim mods.
What Does It Do?
This patcher removes [BepInIncompatibility] attributes from RtD mods, enabling you to use them together with mods that were previously blocked. The mods themselves work fine together - this simply removes the restrictions.
Affected RtD Mods:
- RtDOcean
- RtDVines
- RtDMonsters
- RtDSouls & RtDSouls_Addon
- RtDBiomes
- RtDMonstrum
- RtDDungeons
- RtDFairyTale
- RtDGardening
- RtDHorrors
- RtDItems
- RtDMagic
- RtDLegends
- RtDMythics
- RtDQuestForge
Previously Blocked Mods (Now Compatible):
- CookieMilk.MagicalMounts
- CookieMilk.MajesticChickens
- CookieMilk.BuildPieces
- CookieMilk.CarryMeMaster
- CookieMilk.DiscordControl
- CookieMilk.UltimateServerControl
- Therzie.MonstrumDeepNorth
- Therzie.WarfareFireAndIce
- Therzie.Monstrum
- Therzie.Armory
- Therzie.Wizardry
- Therzie.Warfare
- blacks7ar.MagicPlugin
- blacks7ar.MagicRevamp
- blacks7ar.SeedBed
- blacks7ar.OreMines
- blacks7ar.BowPlugin
- randyknapp.mods.epicloot
- org.bepinex.plugins.valheim_plus
Installation
IMPORTANT: This is a PATCHER, not a regular plugin!
- Download NoArbitraryIncompatibilityFlag.dll
- Place it in BepInEx/patchers/ folder (NOT plugins!)
- Launch the game
- The patcher will automatically process RtD mods on startup
How It Works
The patcher uses a dual-layer approach combining Cecil IL patching with Harmony runtime patches. All modifications are in-memory only - no files are ever modified on disk.
On launch, you'll see:
Processing RtDVines.dll...
Stripped 19 incompatibility attribute(s) from RtDVines
Neutered RtDVines.Fail()
Removed 4 Fail() call(s) from RtDVines.Awake()
✓ Cecil IL patching complete - RtD detection code neutralized
✓ Harmony fallback: Ready to bypass incompatibility checks
✓ Harmony fallback: Ready to hide from ContainsKey detection
✓ Harmony fallback: Ready to hide assembly name
✓ Harmony fallback: Ready to filter GetAssemblies
✓ Found RtD mod: RtDVines
✓ Successfully bypassed incompatibility checks for 1 RtD mod(s)
Technical Details
RtD mods added four detection checks in their Awake() method:
- IL Bytecode Integrity Check: Verifies their "Block" method hasn't been modified
MethodInfo method = typeof(RtDMod).GetMethod("Block",...);
byte ilAsByteArray = method?.GetMethodBody()?.GetILAsByteArray();
if (method == null || ilAsByteArray == null || ilAsByteArray.Length a.GetName().Name.Contains("NoArbitraryIncompatibilityFlag")))
Fail();
- Module Name Scan: Searches all loaded assembly modules for our name
if (AppDomain.CurrentDomain.GetAssemblies().Any(a => a.ManifestModule.Name.IndexOf("NoArbitraryIncompatibilityFlag", StringComparison.OrdinalIgnoreCase) >= 0))
Fail();
The patcher uses a dual-layer defense strategy. The Cecil layer runs during BepInEx's preloader phase, before any plugin code executes. BepInEx loads each RtD DLL into memory as an AssemblyDefinition object, passes it to our Patch() method, we modify the IL instructions, and BepInEx loads the modified version into the CLR. The original DLL on disk is never touched.
Cecil IL Patching (Primary Defense)
- Strip Incompatibility Attributes: Removes all [BepInIncompatibility] custom attributes from types. This is the primary goal - removing the actual incompatibility declarations.
- Neuter Fail() Method: Replaces the method body with just ret. Even if detection checks somehow execute, calling Fail() does nothing.
// Before:
private static void Fail() {
throw new Exception("Mod integrity check failed.");
}
// After:
private static void Fail() {
return; // Does nothing
}
- Strip Static Constructor Throws: NOPs throw statements in.cctor. Finds static constructors that contain integrity check strings and replaces ldstr + newobj Exception + throw with nop instructions.
- Strip Fail() Calls from Awake(): NOPs all calls to Fail() in the Awake method. Fi
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.