ModelReplacementAPIHotfix
Hotfix for ModelReplacementAPI 2.4.19: fixes held item slot errors and disables MoreCompany cosmetics on model replacements.
About this mod Author’s original text
ModelReplacementAPI Hotfix
A small compatibility hotfix for ModelReplacementAPI 2.4.19 in Lethal Company. Imporved compatibility with MoreCompany cosmetics.
This mod is intended for modpacks where the original BunyaPineTree-ModelReplacementAPI is still required by other model replacement mods, but causes errors on newer Lethal Company versions or with reserved/item slot mods.
What this fixes
This hotfix currently addresses several common issues:
- Fixes IndexOutOfRangeException in LocateHeldObjectsOnModelReplacementPatch.LateUpdatePatch.
- Adds safer held-item slot handling when currentItemSlot points outside the vanilla ItemSlots array.
- Prevents repeated NullReferenceException spam from BodyReplacementBase.LateUpdate.
- Disables unsafe MoreCompany cosmetic rendering on players using model replacement skins.
- Helps prevent log spam when switching between incompatible model replacement suits.
Why this is needed
The original ModelReplacementAPI 2.4.19 assumes that the player's selected item slot always exists inside the vanilla ItemSlots array.
With newer Lethal Company versions and mods such as reserved hotbar/item slot mods, currentItemSlot may point to a reserved/tool slot outside the normal item slot array. This can cause errors like:
IndexOutOfRangeException
ModelReplacement.Patches.LocateHeldObjectsOnModelReplacementPatch.LateUpdatePatch
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.
Install these first, or the mod will not work: