Confirm with your password

BepInExPack Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Client & Server Valheim 1.0

Stars
10
Downloads
5.4k
Version
5.4.2351
Updated
Author
denikson
Virus scan
✓ Scan successful
Runs on
Client & Server

Description

BepInEx logo

Due to Thunderstore limitations, if there is information that needs to be live updated or shared about this pack it will be listed on the Wiki tab of the package. If you need to have something listed there, please contact one of the maintainers.

BepInExPack for Valheim

This is BepInEx 5.4.23.5 pack but pre-configured for Valheim. It is maintained by Azumatt, Vapok, and Margmas in the Valheim community. The specific changes and deviations from upstream BepInEx can be see in Azumatt's Repo. If changes to the pack need to be made but BepInEx itself doesn't need to update typically we will increment the version for Thunderstore. Example: 5.4.2202, this does not mean that BepInEx itself needed to update, likely it's a small change for the game or something needed to change in the description etc.

BepInEx is a general purpose framework for Unity modding. BepInEx includes tools and libraries to

  • load custom code (hereafter plugins) into the game on launch;
  • patch in-game methods, classes and even entire assemblies without touching original game files;
  • configure plugins and log game to desired outputs like console or file;
  • manage plugin dependencies.

BepInEx is currently one of the most popular modding tools for Unity on GitHub.

This pack's contents

This pack is preconfigured and usable for Valheim modding.
In particular, the changes from base BepInEx releases are:

  • Added preconfigured BepInEx.cfg with console enabled and correct entry point for mods.
  • Added scripts necessary to run both game and dedicated server on Linux machines or through r2modman
  • Edited BepInEx preloader to help with some mods patching
  • Force the Valheim Game class isModded flag to true after the chainloader loads.
  • Thunderstore version of the pack is printed to the console since it's separate from the actual BepInEx version if only site changes are needed.
  • Plugins can use semver version strings like 1.2.0-beta.1. Base BepInEx 5 throws those plugins out with an "invalid version" warning.

Issues, questions, etc.

🔴IMPORTANT❗🔴 DO NOT ASK FOR HELP in the Official BepInEx Discord

The Valheim community runs a customized version of BepInEx and the official BepInEx folks are unable to help.

If you are having problems with BepInEx in general, mods running on Valheim, or unsure between the two, please seek assistance from ANY of the Discords of the maintainers listed below.

Current BepInEx for Valheim Maintainers:

Installation (game, automated)

This is the recommended way to install BepInEx on the game.

  1. Download and install Gale, Thunderstore Mod Manager or r2modman
  2. Click Install with Mod Manager button on top of the page
  3. Run the game via the mod manager

Installation (server, automated)

There are some managed dedicated server that support simple and automatic BepInEx installation.
Here is a list of known ones (list updated as more is known).
Note: Some of the links may be affiliate links

Valhost.net

ValheimServerHosting

XGamingServer

Installation (manual)

If you are installing this manually, do the following

  1. Start with a clean install. Make triple sure your Valheim folder is clean and unmodified

  2. Click the Manual Download button on the package page above to download the archive, it looks like this:

    Manual Download Button

  3. Once saved to your computer, extract the archive into a folder. Do not extract into the game folder.

  4. Move the contents of BepInExPack_Valheim folder into <Steam Location>\steamapps\common\Valheim.

    Moving contents of BepInExPack_Valheim

  5. Check that you have installed it correctly. If done correctly, your folder will look as follows

    BepInEx, winhttp.dll, and doorstop_config.ini in Valheim folder.

  6. Follow either Windows or Linux game running instructions below:

Configuration (Windows)

No need to configure. Simply run the game. If everything is correct, you will see a console pop up.

Configuration (Linux, game)

  1. Make start_game_bepinex.sh executable with chmod u+x start_game_bepinex.sh.

  2. In Steam, go to game's properties and set game's launch arguments to

    ./start_game_bepinex.sh %command%
    

    Note to advanced users: You can change ./start_game_bepinex.sh to full path to the script. This way you can install this pack entirely outside of game folder.

  3. Run the game via Steam.

At this moment you will not see any clear indication if BepInEx works. It is suggested to test by installing a simple plugin such as MessageCenter from BepInEx.Utility.

Configuration (Linux, server)

This guide assumes you have enough knowledge working with Linux.
If not, it is suggested you use a server host that supports it out of the box.

  1. Make start_server_bepinex.sh executable with chmod u+x start_server_bepinex.sh.
  2. Edit start_server_bepinex.sh to change the launch parameter like you would with Valheim's own launch script.
  3. Run start_server_bepinex.sh to start the server.

If done correctly, you will see BepInEx bootstrap messages in the terminal.

Configuration (macOS)

Valheim has a native macOS build, but BepInEx does not run natively on Apple Silicon yet, so the game has to be forced through Rosetta.

  1. Make start_game_bepinex.sh executable with chmod u+x start_game_bepinex.sh.

  2. In Steam, go to game's properties and set game's launch arguments to

    /usr/bin/arch -x86_64 /bin/bash ./start_game_bepinex.sh %command%
    
  3. Run the game via Steam.

If you leave off the arch -x86_64 part on an M-series Mac, the game still launches, it just launches without BepInEx and none of your mods load. Intel Macs don't need it.

This is not something we can fix in the pack. BepInEx 5 leans on MonoMod, and MonoMod has no arm64 support yet. If you want to follow along, it's BepInEx#899.

Checking BepInEx version and load status

If BepInEx was loaded successfully into the game, you should see a BepInEx console window launched next to the game in the taskbar (Windows):

Stacked: BepInEx console window in taskbar

Expanded: BepInEx console window in taskbar 2

Confirm no errors or issues by having Grey/White text in the console only (Info and Message). Red are fatal errors, Dark Red are errors, Yellow are warnings, Dark Gray are debug, and any other color is a custom message.

BepInEx console window

Useful links

Changelog

5.4.2351 Latest

Logging

Changed

  • Every plugin line now has the GUID after the name, e.g. Loading [AzuExtendedPlayerInventory 2.5.1] (Azumatt.AzuExtendedPlayerInventory). Two mods with the same name are easy to tell apart now, and log parsers still read the bracketed part the same way as before.
  • Chainloader startup complete now ends with counts, e.g. (41 loaded, 2 skipped, 1 failed).

Fixed

  • Valheim Version: line actually shows up in LogOutput.log now like it used to.
  • When the same GUID is installed twice, the skip warning shows where both copies are (relative to BepInEx/plugins) so you know which one to delete. If both copies are the same version it says it's a duplicate instead of claiming a newer version exists.

Doorstop

Changed

  • libdoorstop_x64.so is now the stock UnityDoorstop 4.5.0 build, byte-for-byte from the upstream release. It only needs glibc 2.7 or newer, so Linux servers older than Ubuntu 22.04 and Debian 12 can load it too. winhttp.dll and the macOS lib are unchanged.
5.4.2350

Updated to BepInEx 5.4.23.5 from 5.4.23.3.

Plugin metadata

Fixed

  • Semver version strings now load. A plugin declaring something like [BepInPlugin("com.example.mod", "My Mod", "1.1.0-beta.2")] got thrown out at startup with Skipping type [X] because its version is invalid. buried in the log and nothing else to go on. The version now gets split at the first - or + so the numeric part parses, and the suffix is kept in a new BepInPlugin.VersionExtra property so it still shows up in the log line and in config file headers.

UnityLogListener

Changed

  • We had our own Unity 6 fix and upstream added theirs, so both were sitting in the same constructor doing nearly the same job. It's one block now: resolve UnityEngine.UnityLogWriter from the loaded CoreModule, try the public WriteStringToUnityLog(string), fall back to the private WriteStringToUnityLogImpl(string), then to the old stub for pre-Unity 6 games. Nothing behaves differently, there's just one path to read instead of two.

Picked up from upstream

Fixed

  • The chainloader no longer dies on builds that have had Unity's log callbacks stripped out of them (#1392).
  • XTermFix and ConsoleSetOutFix are wrapped now, so when they throw on macOS the preloader carries on instead of taking BepInEx down with it (#1288).

Notes

  • Doorstop stays at 4.4.0 on purpose, and that includes our libdoorstop_x64.so built against glibc 2.34 for Ubuntu 22.04 and Debian 12. Nothing on the native side changed this release, winhttp.dll included.
  • Apple Silicon still needs the game forced through Rosetta. There's a macOS section in the README now covering it.
  • The .pdb files are gone from BepInEx/core. Upstream stopped shipping them and we had no reason to keep them.

5.4.2333

UnityLogListener

Fixed

  • Unity 6 compatibility: We now bind directly to Unity’s real UnityEngine.UnityLogWriter from UnityEngine.CoreModule instead of our local stub. This fixes cases where the listener failed to start on Valheim 0.221.3 (Call to Arms PTB) with Unity 6000.0.46f1, which showed:

    • [Error : BepInEx] Unable to start Unity log writer

Hardening

  • Only hook a method that exactly matches WriteStringToUnityLog(string) and probe it safely before using it.
  • If the Unity 6 method isn’t available, we fall back to the legacy stub (older Unity versions continue to work).
  • Keep the existing guard to avoid double-writing console output; the Logging.LogConsoleToUnityLog config still behaves the same.

Preloader

Changed

  • Log Valheim version earlier: Print the game version (with network version) before the chainloader runs, so the info is captured even if the game crashes during early startup.

35 older entries, full version history & downloads →

Manual installation instructions

Install BepInExPack Valheim

BepInExPack Valheim is required to run mods in Valheim.

Download BepInExPack Valheim 5.4.2351 · View mod page

Check out the mod page for detailed installation instructions.