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
12
Downloads
10.5k
Version
5.4.2360
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.6 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, and BepInEx can run it natively on Apple Silicon now too.

  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

    /bin/bash ./start_game_bepinex.sh %command%
    
  3. Run the game via Steam.

On Apple Silicon the script runs the game natively by default. That's how upstream ships it, and upstream tested it on Valheim (BepInEx#1402). We haven't run it with this pack ourselves yet though. If your mods don't load, open start_game_bepinex.sh and set archpreference="x86_64" to force Rosetta. Intel Macs don't need to change anything.

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.2360 Latest

Updated to BepInEx 5.4.23.6 from 5.4.23.5.

Doorstop

Changed

  • Bumped to UnityDoorstop 4.6.0, and match what upstream ships in 5.4.23.6.
  • The .so still only needs glibc 2.7. Older Linux servers are fine.
  • The macOS lib is universal now (x86_64 and arm64). It used to be x86_64 only.

Fixed

  • Windows: 4.6.0 patches a buffer overflow in Doorstop's boot.config redirect hook (UnityDoorstop#106).

Start script (macOS)

Changed

  • start_game_bepinex.sh uses upstream's 4.6.0 macOS launch code now. It always goes through arch, and the new archpreference setting at the top picks the architecture. The default is upstream's arm64,x86_64, which means native on Apple Silicon.
  • The old /usr/bin/arch -x86_64 /bin/bash ./start_game_bepinex.sh %command% launch line still works, but it doesn't force Rosetta anymore. Set archpreference="x86_64" in the script if you want Rosetta.
  • The Steam overlay should survive the launch now. The script passes STEAM_DYLD_INSERT_LIBRARIES to the game after Doorstop.

Picked up from upstream

Fixed

  • Apple Silicon Macs running the game natively (no Rosetta) load plugins now. Before, BepInEx just sat there doing nothing and never wrote LogOutput.log (#1402). That fix was tested on Valheim, on an M4 Pro.

Notes

  • Native is upstream's default and upstream tested it on Valheim, but I haven't run it with this pack myself yet. If mods don't load on an M-series Mac, archpreference="x86_64" puts you back on Rosetta.
5.4.2351

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.

36 older entries, full version history & downloads →

Files

31 files · 709 KB download

Loading files…

Manual installation instructions

Install BepInExPack Valheim

BepInExPack Valheim is required to run mods in Valheim.

Download BepInExPack Valheim 5.4.2360 · View mod page

Check out the mod page for detailed installation instructions.