ComponentBundler

v1.0.2·Updated 2024-07-31

Mod utility for adding components in Awake

About this mod Author’s original text

ComponentBundler

Utility mod for Lethal Company (and any game with BepInEx) which allows you to bundle your own components with built-in ones.

The main use case of this mod is to add a NetworkBehaviour before the NetworkObject is spawned.

The reason we can't just patch a script on the target NetworkObject to do this is because of two reasons:

  • NetworkObject spawning occurs after Awake but before Start.
  • Most MonoBehaviours in the game don't have an Awake method, and it cannot be added through runtime patching (Harmony).

This mod works by running a preload patcher which adds Awake methods where it is needed.

Usage

No code is required!

  • Install the mod through and add it as a dependency for your mod.
  • Add a file to BepInEx/plugins// called bundler_config.json.
  • The content should be a JSON object, where the keys are namespaced names of the game components you want to target. The values should be arrays of namespaced names of your components that you want to bundle. For example:

{

"FlashlightItem": [

"MyMod.FlashlightAddition"

],

"GameNetcodeStuff.PlayerControllerB": [

"MyMod.Player.PlayerComponent1",

"MyMod.Player.PlayerComponent2"

]

}

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. 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.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. 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.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack

File & checksum

Filename
ComponentBundler-1.0.2.zip
File size
65.2 KiB