You are viewing a potentially older version of this package. View all versions.
Xtasy-ValheimDeathBan-1.1.4 icon

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.4
Download link Xtasy-ValheimDeathBan-1.1.4.zip
Downloads 20
Dependency string Xtasy-ValheimDeathBan-1.1.4

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2351 icon
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.2351

README

Valheim Death Ban

Standalone permadeath mod. When a connected player dies, the server bans their account and disconnects them after a configurable delay. Creating a new character on that account does not bypass the ban.

Features

  • Persistent account bans using Valheim's native ban list.
  • Configurable delay before banning and disconnecting.
  • Admin immunity through the server's adminlist.txt.
  • UTF-8 death journal: timestamp, character name, account ID, reason, source and exemption flag.
  • Optional client reporting of death reasons and attacker names when available.
  • Local-world host deaths are logged; the host is always exempt.
  • No Jotunn or ValheimEnforcer dependency.

Installation

Install BepInExPack Valheim and this mod on the server. For manual installation, copy ValheimDeathBan.dll to BepInEx/plugins/ValheimDeathBan/.

Players do not need this mod for server bans. Install the same mod version on players' clients to report death reasons. Without the client mod, the reason is recorded as unknown. The local host's reason is recorded directly.

Configuration

Created after first launch: BepInEx/config/com.xtasy.ValheimDeathBan.cfg

[General]
Enabled = true
KickDelaySeconds = 3
BanAdmins = false
Setting Default Effect
Enabled true Enable death processing and bans on the server.
KickDelaySeconds 3 Delay before applying the ban and disconnecting.
BanAdmins false Exempt accounts in the server's admin list when false.

Existing config values are preserved. If your config has BanAdmins = true, change it manually to false for admin immunity. Immunity does not remove existing bans. Restart after editing configuration.

Death journal

BepInEx/config/ValheimDeathBan/deaths.txt

The journal appends the server's local timestamp with time-zone offset, player name, account ID, reason, data source and exemption flag. Reason labels are currently in Russian. 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).

Managing bans

Death bans use the standard bannedlist.txt together with administrative bans. Use Valheim'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 1.1.2.

Limitations

  • Death detection relies on the game's death RPC; this is not an anti-cheat system. A modified client that suppresses the RPC can evade detection.
  • Detailed reasons are client reports, not independent server verification. A reason report alone never triggers a ban.
  • Damage-over-time deaths may not retain the original attacker. A zero-second delay can prevent the reason report from arriving in time.
  • The local-world host is always exempt, regardless of BanAdmins.
  • Developed against the supplied Valheim 1.0.15 assembly, targeting .NET Framework 4.7.2 and BepInEx 5. Compatibility with other game versions is not guaranteed.

Русский

Установить на сервер; на клиентов — дополнительно для причины смерти. Банится аккаунт, а не только персонаж. Баны постоянные и хранятся в штатном bannedlist.txt.

BanAdmins = false даёт иммунитет администраторам из adminlist.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.Enabled as 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.ScanIntervalSeconds to 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.