Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
ValheimDeathBan
Ban accounts after character death. Persistent bans, admin immunity and a death journal. Server handles bans; optional client installation adds death reasons.
By Xtasy
| Date uploaded | 2 weeks ago |
| Version | 1.1.12 |
| Download link | Xtasy-ValheimDeathBan-1.1.12.zip |
| Downloads | 86 |
| Dependency string | Xtasy-ValheimDeathBan-1.1.12 |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2351README
Valheim Death Ban
Standalone permadeath mod for Valheim. When the server detects a connected player's death, it bans their account and disconnects them after a configurable delay. Creating a new character on the same account does not bypass the ban.
Features
- Persistent account bans using Valheim's native ban list.
- Server-side death detection through the
s_deadflag in character ZDO data, without requiring loaded player models. - Configurable player scan interval and ban/disconnect delay.
- Admin immunity through the server's
adminlist.txt. - UTF-8 death journal with timestamps, character names, account IDs, raw reasons, sources and exemption status.
- Optional Discord webhook notifications, including the ban outcome.
- Global chat announcements and queued red banners using the Valheim-Norsebold font.
- Shared Russian death messages across chat, banners and Discord.
- Configurable server scan diagnostics.
- Local-world host deaths are logged; the host is always exempt from bans.
- No Jotunn, PvP Tweaks or ValheimEnforcer dependency.
Installation
Install BepInExPack Valheim and this mod on the server. For manual installation, copy ValheimDeathBan.dll to BepInEx/plugins/ValheimDeathBan/.
| Installation | Available features |
|---|---|
| Server only | Death detection, account bans, journal, diagnostics and Discord notifications with the available reason. |
| Server and clients | Adds client death-reason reports, chat announcements and on-screen banners. |
Install the same version on the server and all clients for the full feature set. Without a client reason report, the server records an unknown reason and the public message uses the generic death sentence. The local-world host's reason is read directly.
Configuration
Created after the first launch:
BepInEx/config/com.xtasy.ValheimDeathBan.cfg
[General]
Enabled = true
KickDelaySeconds = 3
BanAdmins = false
ScanIntervalSeconds = 0.25
[Announcements]
Chat = true
Banner = true
BannerSeconds = 8
[Discord]
Enabled = false
WebhookUrl =
[Diagnostics]
Enabled = true
LogIntervalMinutes = 15
| Setting | Default | Description |
|---|---|---|
| General.Enabled | true | Enable server death processing and bans. |
| General.KickDelaySeconds | 3 | Delay after death detection before applying the ban and disconnecting. |
| General.BanAdmins | false | Exempt accounts in adminlist.txt when false. |
| General.ScanIntervalSeconds | 0.25 | Seconds between server scans; range 0.05–30. |
| Announcements.Chat | true | Server broadcasts shout-style chat death announcements to modded clients. |
| Announcements.Banner | true | Server broadcasts red death banners to modded clients. |
| Announcements.BannerSeconds | 8 | Banner duration on each client, clamped to 1–60 seconds. |
| Discord.Enabled | false | Enable server-side webhook notifications. |
| Discord.WebhookUrl | empty | Discord webhook URL; empty disables sending. |
| Diagnostics.Enabled | true | Enable server scan timing and periodic diagnostic logs. |
| Diagnostics.LogIntervalMinutes | 15 | Minutes between diagnostic reports; range 0.1–1440. |
Existing values are preserved when updating. If your old configuration has BanAdmins = true, change it to false to enable admin immunity. Immunity does not remove existing bans.
After manually editing the configuration file, restart the server or client concerned. Banner duration is a client setting; the server controls whether chat and banner announcements are broadcast.
A larger scan interval reduces check frequency but increases death-detection latency. Synchronization delay also affects detection. The disconnect delay starts when death is detected, not at the exact moment of the client's death.
Death messages
The same Russian sentence is used in chat, the banner and the first line of Discord notifications. Character names are inserted as-is, without grammatical declension.
| Cause | Example |
|---|---|
| Creature attack | Древний убивает Дэнчик |
| Falling | Дэнчик разбился |
| Falling tree | Дерево придавило Дэнчик |
| Drowning | Дэнчик утонул |
| Poison | Дэнчик отравился |
| Freezing | Дэнчик замёрз |
| Fire / cinder fire | Дэнчик сгорел |
| Other or unknown causes, including PvP | Дэнчик усоп |
Creature names use available Russian localization data with fallback names for standard creatures. If a Russian name is unavailable, the message uses Неизвестное существо.
Chat announcements use shout-style rendering and are broadcast to all clients with the mod, without a distance restriction. Banners appear near the top of the screen in red with a black outline. Multiple deaths are queued; at most 100 banners wait in the queue, and the oldest waiting entry is dropped if it overflows. If the Norse font asset is unavailable, the game's message font is used instead.
Admin and local-host deaths are also announced. Disable overlapping death notifications in PvP Tweaks if you use both mods.
Discord
Create a webhook for a Discord text channel and configure it on the server:
[Discord]
Enabled = true
WebhookUrl = https://discord.com/api/webhooks/ID/TOKEN
Notifications include the death sentence, account ID, death-detection timestamp with the server's time-zone offset, and ban outcome. Exempt administrators and local-world hosts are identified as exempt. Ban failures are reported as errors rather than successful bans.
The webhook URL is not synchronized to clients. Keep it private and exclude it from published packages and shared configuration files.
Delivery runs asynchronously through a bounded queue with a 10-second request timeout and limited retries for Discord rate limits. Discord errors do not prevent death logging or bans. Mentions are disabled. Pending notifications are not persisted and can be lost when the process stops. Ordinary network failures are not retried automatically to avoid uncertain duplicate deliveries.
Death journal
BepInEx/config/ValheimDeathBan/deaths.txt
The append-only UTF-8 journal includes server-local timestamps with time-zone offsets, names, account IDs, raw reasons, sources and exemption flags. Public message wording does not replace the detailed reason in this file. Raw creature names may be localization keys such as $enemy_troll.
Admin deaths are logged even when exempt. Local-host entries use id=local-host and source=local host (ban exempt).
Diagnostics
Server diagnostics are written to BepInEx/LogOutput.log, every 15 minutes by default. Reports include:
- Last, average and maximum full-scan times in milliseconds.
- Player-list traversal times.
- Combined ZDO lookup and death-flag read times per scan.
- Scan counts, scan failures, player counts, tracked characters and lookup/read counts.
The full-scan measurement excludes the delay between scans and asynchronous Discord delivery. Previously connected characters remain tracked for up to 30 seconds, so the tracked-character count may exceed the connected-player count.
Set Diagnostics.Enabled = false to disable timing measurements and diagnostic reports. Death detection continues to run. The first report appears after the configured interval; statistics reset after each report and when entering a new world.
Managing bans
Death bans use Valheim's standard bannedlist.txt together with administrative bans. Use the game's standard ban management to remove them. Disabling or uninstalling this mod does not remove previous bans.
Custom deathban list, deathban unban and deathban clear commands are not implemented in version 1.1.11.
Detection and limitations
The server binds connected accounts to character ZDO IDs and periodically reads s_dead. Each detected dead character is processed once. Previous character bindings remain tracked for 30 seconds after character changes or disconnection to allow delayed synchronization. A missing ZDO is not treated as a death.
Client reports provide reasons only and do not initiate bans. However, character state still arrives through game synchronization: this mod is not an anti-cheat system or independent proof of death. Delayed or missing synchronization can delay or prevent detection.
Damage-over-time deaths may lose the original attacker. A zero-second disconnect delay may prevent a reason report from arriving in time. The local-world host is always exempt regardless of BanAdmins.
Targets BepInEx 5 and .NET Framework 4.7.2. Developed against supplied Valheim game assemblies; compatibility with future game versions and other mod combinations is not guaranteed.
Русский
Банится аккаунт, а не отдельный персонаж. Мод на сервере обнаруживает смерть по s_dead в ZDO; модель персонажа не требуется. Клиентский мод нужен для передачи причины смерти, сообщений в чате и красного баннера.
BanAdmins = false даёт иммунитет администраторам из adminlist.txt; их смерти всё равно записываются и объявляются. Хозяин локального мира всегда освобождён от бана.
Частота проверок: General.ScanIntervalSeconds. Диагностика: Diagnostics.Enabled и Diagnostics.LogIntervalMinutes. Discord включается отдельно на сервере через Discord.Enabled и Discord.WebhookUrl.
Баны сохраняются в штатном bannedlist.txt. Журнал: BepInEx/config/ValheimDeathBan/deaths.txt. Команды deathban пока отсутствуют.
CHANGELOG
Changelog
1.2.8
- Added
General.BanOnDeath, enabled by default, to choose whether a confirmed death causes an account ban and disconnection. - With
BanOnDeath = false, retain the journal, chat, banners and enabled Discord notifications without a death-ban action. - Cancel pending ban actions and stop further retries when the setting is disabled before the action is applied.
- Do not retroactively ban deaths processed with bans disabled. Existing native bans remain unchanged.
- Keep
General.Enabledas the separate switch for death processing as a whole. - Added regression coverage for the default, repeated deaths without bans and setting changes during pending actions.
- Kept the reason/announcement protocol compatible with clients 1.2.7 and 1.2.8.
- Reworked the README with current configuration defaults, installation steps and upgrade instructions.
1.2.7
- Fixed administrator immunity by using the game's native administrator check, including platform-qualified Steam IDs.
- Apply bans directly to the captured account ID; character-name collisions no longer redirect the ban to another account.
- Disconnect the actual matching account connection instead of resolving a player by name.
- Verify saved native ban-list entries through the game's local/cloud storage reader before reporting success.
- Retry failed bans up to five times, with pauses of 2, 4, 8 and 16 seconds, without repeating the journal or announcements.
- Limited
General.ScanIntervalSecondsto 0.05–1 second to reduce deaths missed before normal respawn removes the old character state. Older larger values are clamped. - Replaced routed messages with direct connection RPCs. Server-bound death reasons use the actual sender connection; clients accept announcements only from their actual server connection.
- Bound reasons to character ZDO IDs and rejected reports from other accounts or already closed death events.
- Cancel pending account jobs and unregister connection handlers when the server/world changes.
- Restore the cloned banner renderer's tint when showing a message.
- Updated DLL version metadata, configuration descriptions and isolated regression tests.
- Clients older than 1.2.7 need updating for reasons, chat and banners; server-side detection and bans continue to work without a client mod.
1.2.6
- Added Enforcer.WhitelistExemptAdmins (default true) for native adminlist accounts.
- Added automatic configuration-file reload on the main thread after saved changes settle.
- Disabled per-entry config saves during reload and added retries for file access failures.
1.2.5
- Removed computer-name reporting, machine-check RPCs, configuration entries and machine journaling.
1.2.4
- Removed hardcoded creature-name lists; Russian and English dictionaries now start empty and load from game localization tables.
- Retained unknown-creature messages and delayed retries when translations are unavailable.
1.2.3
- Added killer and victim names to PvP death announcements in chat, banners and Discord.
- Added a fallback message when the attacking player name is unavailable.
1.2.2
- Added the client-local Announcements.BannerFontSize setting (16–120, default 60).
- Preserved automatic font shrinking for long messages and scaled the banner area for larger fonts.
1.2.1
- Loaded both Russian and English creature names from game localization.
- Selected Russian names for Russian clients and English names for every other client language.
- Updated announcement RPCs; server and clients must be updated together.
1.2.0
- Added optional ValheimEnforcer integration with separate integration and whitelist switches.
- Added server-side admission checks against Enforcer’s character account database, supporting YAML and internal storage.
- Disabled whitelist checks when integration is disabled or Enforcer is not loaded.
- Rejected unknown accounts and database-check failures while the whitelist is active.
- Added a UTF-8 journal for rejected whitelist attempts.
- Added Russian creature-name loading from game localization tables with delayed retries.
- Loaded localization tables without invoking the Localization constructor, preserving the global translation handler.
1.1.13
- Fixes
1.1.12
- Updated README with current features, configuration options and installation instructions.
- No code changes.
1.1.11
- Added server-side Discord webhook notifications with death messages, account IDs, timestamps, and ban outcomes.
- Added notifications for exempt administrators and local-world hosts.
- Added asynchronous Discord delivery with a bounded queue, request timeout, and limited rate-limit retries.
- Added death announcements in chat using the PvP Tweaks rendering approach.
- Added large red death banners using the Valheim-Norsebold font.
- Added a banner queue for multiple deaths.
- Added shared Russian death messages for creature attacks, falling, drowning, trees, poison, freezing, and fire.
- Preserved detailed death reasons in the text journal.
- Added configurable player scan intervals through General.ScanIntervalSeconds, defaulting to 0.25 seconds.
- Added diagnostic logs with the last, average, and maximum scan times, player counts, ZDO checks, and scan failures.
- Added Diagnostics.Enabled, enabled by default, and Diagnostics.LogIntervalMinutes, defaulting to 15 minutes.
- Disabling diagnostics stops timing measurements and diagnostic logs without affecting death detection.
- Preserved server-side death detection, persistent bans, admin exemptions, and the configurable disconnect delay.
- Client installation is required for chat announcements, banners, and death-reason reporting. Server-side death detection and bans continue to work without the client mod.
1.1.4
- Switched death detection to the s_dead flag in the server’s copy of character ZDO data.
- Added checks every 0.25 seconds without requiring player models to be loaded on the server.
- Client reports now provide death reasons only and no longer trigger bans.
- Removed reliance on Player.RPC_OnDeath for death detection.
- Added protection against processing the same death more than once.
- Previous characters remain tracked for 30 seconds after character changes or disconnection to allow delayed synchronization.
- Preserved admin exemptions, death logging, and the configurable disconnect delay.
- Client installation is no longer required for death detection. The client mod is only needed to report the cause of death.
1.1.2
- Added direct death journaling for local-world hosts.
- Exempted the local-world host from bans.
- Avoided peer lookup warnings for local-host deaths.
1.1.1
- Fixed private GetServerPeerID access using reflection.
1.1.0
- Added a UTF-8 death journal with timestamps, names, account IDs, reasons and exemption status.
- Added optional client reporting of death reasons and attacker names.
- Changed the default BanAdmins value to false.
- Added the UnityEngine facade reference required for building.
- Captured account IDs at death to preserve them across disconnects during the delay.
1.0.0
- Initial development version with native persistent account bans, configurable kick delay and admin exemption setting.