MrDayNight
MrDayNight is a simple yet powerful mod that lets you control the duration of day and night in Valheim.
模組介紹 作者原文
🕰️ MrDayNight
by Genesis Project
Take control of Valheim’s time itself — extend the light, embrace the dark.
📜 Overview
MrDayNight is a simple yet powerful mod that lets you control the duration of day and night in Valheim.
Customize how long the sun shines or how long the shadows last — whether you want endless daylight or a world trapped in eternal night.
Perfect for both server administrators and solo adventurers, it provides fine-grained control over the day/night cycle while staying fully synced across multiplayer worlds.
⚙️ Features
- ✅ Customize day length and night length individually (in seconds).
- ✅ Fully synchronized across clients when used on a server with Jötunn.
- ✅ Automatically enforces server settings — players cannot override them.
- ✅ Works in single player (local settings) and multiplayer (server-synced).
- ✅ Clean logs and 100% compatible with all environment mods.
🔧 Configuration
After launching the game once, the config file will be created at:
BepInEx/config/genesisproj.mrdaynight.cfg
Example:
[Tempo]
Duração do dia em segundos (default = 1200)
Setting type: Single
Default value: 1200
DayLength = 1200
Duração da noite em segundos (default = 600)
Setting type: Single
Default value: 600
NightLength = 600
🧩 Dependencies
| Mod | Required | Purpose |
|------|-----------|----------|
| BepInExPack Valheim | ✅ | Core mod loader |
| Jötunn | ✅ | Syncs configurations between server and clients |
🧠 How It Works
- When a world starts, MrDayNight hooks into the EnvMan initialization.
- The mod sets EnvMan.m_dayLengthSec based on your chosen values.
- On servers, these values are propagated to all connected players automatically.
- In single player, your local config values are used.
🏰 Server Behavior
| Environment | Behavior |
|--------------|-----------|
| Dedicated server with Jötunn | Server config is enforced on all clients. |
| Single player | Local configuration applies. |
| Vanilla server (without Jötunn) | Each client uses local config independently. |
🧑💻 Technical
- Built using BepInEx 5.4+, HarmonyX, and Jötunn 2.26.1.
- Written in C# targeting.NET Framework 4.8.
- Thread-safe, no reflection abuse, and uses clean Harmony patches.
📦 Installation
- Install BepInExPack for Valheim.
- Install Jötunn.
- Extract the contents of this mod to:
Valheim/BepInEx/plugins/
- Launch the game.
- Configure and enjoy your custom day/night balance.
🧙♂️ Credits
- Developed by BRKiHeL / Genesis Project
- Built with Jötunn Modding Framework
- Inspired by Valheim’s mystical world and community creativity
🐉 License
This project is open source under the MIT License.
Feel free to modify or redistribute, crediting Genesis Project.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: