DashTheDev.7D2D.ModCore
1.0.5
dotnet add package DashTheDev.7D2D.ModCore --version 1.0.5
NuGet\Install-Package DashTheDev.7D2D.ModCore -Version 1.0.5
<PackageReference Include="DashTheDev.7D2D.ModCore" Version="1.0.5" />
<PackageVersion Include="DashTheDev.7D2D.ModCore" Version="1.0.5" />
<PackageReference Include="DashTheDev.7D2D.ModCore" />
paket add DashTheDev.7D2D.ModCore --version 1.0.5
#r "nuget: DashTheDev.7D2D.ModCore, 1.0.5"
#:package DashTheDev.7D2D.ModCore@1.0.5
#addin nuget:?package=DashTheDev.7D2D.ModCore&version=1.0.5
#tool nuget:?package=DashTheDev.7D2D.ModCore&version=1.0.5
7D2D Mod Core
A foundational library for 7 Days to Die mod development.
ModCore provides a standardized base structure and common utilities for building 7D2D mods, eliminating boilerplate and preventing mod conflicts through automatic assembly merging.
Quick Start
- Install the NuGet package:
dotnet add package DashTheDev.7D2D.ModCore
- Create your config class:
public class MyConfig : XmlModConfig
{
public string MyProperty { get; set; } = "default";
}
- Create your mod class:
public class MyMod : BaseMod<MyMod, MyConfig>, IModApi
{
// Your mod implementation
}
- Build and be done. Your mod is ready to deploy.
What's Included
BaseMod<T, TConfig>: Base class with overrides handling mod lifecycle, config management, and Harmony patching setup.
IModConfig/BaseModConfig: Mod config interface or base class so that you can easily extend and create your own class that handles config (i.e JSON, etc).
XmlModConfig: Automatic XML serialization/deserialization for mod configuration with support for per-property comments.
Dependency Injection Container: Singleton and transient service registration accessible via YourMod.Instance.Container.
ModLogger: Structured logging with mod-prefixed output for debugging.
GeneralUtility: Common helper methods for logging, reflection, and mod utilities.
Build Process
ModCore automatically merges into your mod DLL using ILRepack, eliminating versioning conflicts between mods. Each mod gets its own isolated copy of ModCore, so multiple mods can use different versions without clash.
Development Setup
- Ensure you have Visual Studio and 7D2D installed
- Clone the repository
- Create a
Local.propsfile in the root:
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GamePath>YOUR_GAME_PATH_HERE</GamePath>
</PropertyGroup>
</Project>
- Build the solution
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- ILRepack (>= 2.0.45)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
XmlModConfig now preserves whitespace and comments when saving to file