
ClanWars
Clan tags, clan friendly fire, alliances, self-unloading caravan trade, Ward-claimed clan bases and raids to capture them.Clan Wars
A BepInEx mod for Valheim 1.0.7 that adds clan tags, clan-based friendly fire, alliances, caravan trade routes between allied clans, Ward-claimed clan bases, and raids on them.
Built and API-verified against assembly_valheim.dll from Valheim 1.0.7
(network version 39, Unity 2022.3, BepInEx 5.4.22).
Features
1. Clan tags
Players found a clan with a short tag and invite others. Tags appear on player name plates and in chat, coloured by how you stand with that player:
| Colour | Meaning |
|---|---|
| green | your own clan |
| blue | allied clan |
| red | rival clan — you can fight |
| grey | no clan |
2. In-game clan panel
Press F6 (configurable) for a panel styled with Valheim's own fonts, wood-panel art and button prefab — it borrows those from the live UI at runtime rather than shipping look-alike assets, so it matches whatever the game is wearing.
Four tabs:
- Roster — members with rank and a green/grey online dot; promote, demote, kick, leave, disband. "Invite" lists the clanless players who are online so you can click one instead of typing a name.
- Diplomacy — allies, incoming and outgoing alliance offers, and every other clan on the server with one-click "Offer alliance" / "Accept" / "Reject" / "Break".
- Trade — your trade posts, open routes with distance and caravan time, live offers with Accept/Decline/Cancel and counter-offers, and every caravan with its state: In transit (counting down), Waiting for space, or Delivered.
- Raids — any raid under way with its time left and Ward-capture progress, and how recent raids ended. Raids themselves are started from the War Map.
The panel blocks player input and frees the mouse like a vanilla window, and Escape closes it instead of opening the game menu. Every button sends a request that the server validates — the panel is a front end, not a second rulebook. There are no chat commands; everything is done from the panel and the chest window.
3. Clan-based friendly fire
- Members of the same clan cannot damage each other, ever.
- Members of different clans can always fight, without either player having to flip Valheim's PvP toggle.
- Allied clans cannot damage each other (configurable).
- When at least one side is clanless, the vanilla PvP toggle still decides (configurable).
Arrows and other projectiles pass straight through clanmates and allies rather than stopping on them.
4. Clan bases and raiding
Clan roster. A clan holds at most 4 players in total - leader, officers and
members all count (MaxClanSize). Invitations do not reserve a place: whoever accepts
first fills it, and the server refuses a join into a full clan. A clan saved with more
players than the limit keeps everyone but takes nobody new until it is below it. The
Roster tab shows Members X / 4 and Clan Full, and a player who has been invited sees
the invitation there with Join and Decline.
Clan bases. A Clan Ward - a blue Ward twice the size of the personal one, free
to build from the Hammer's menu - claims 150 m around it for the clan
(WardClaimRadius). It is always active - there is no switch - and it belongs to the
clan rather than whoever built it: its hover names the clan and its members, and every
clanmate is on its permitted list. It is not a personal Ward: vanilla's Ward rules never apply to
it - only the clan claim does - and when the claim turns someone away, the Ward's shield
flashes across the whole claim. A clan may hold 3 to begin with (MinClanWards);
every Ward it captures in a raid raises its limit by one and every Ward it loses lowers it
by one - never below 3, with no ceiling. One past the limit claims no land. An ordinary
Ward stays a personal, vanilla Ward.
Clan Wards keep their distance, centre to centre: 305 m from another of the same
clan's (FriendlyWardMinimumDistance) and 505 m from any other clan's, allies
included (OtherClanWardMinimumDistance). The server checks every new Clan Ward
against every Ward in the world and takes down one that is too close; the builder is
told the rule, never where the other Ward is.
Inside a claim, anyone outside the owning clan - allies too - cannot build, remove, dig or level ground, open chests, doors, portals and the like, or damage anything. Monsters still attack bases as vanilla intends, and a structure that loses its support still falls.
Finding a base. A base has to be discovered before it can be raided: by a Scout
Raven, or by any member of the clan coming within 200 m of it
(PlayerWardDiscoveryRadius). Either way it becomes known to the whole clan, the clan is
told who found it, and it appears on the War Map. Neither reveals the land, the base
or anyone in it. Allies' bases are found the same way and shown in blue; they can never
be raided. Click one on the War Map to see whose it is and how far away.
Raids start only from the War Map, never by attacking a base.
- An officer or the leader selects a discovered enemy Ward and presses Initiate
Raid. The server checks the clans are not allied, neither is in a raid or on
cooldown, and - no offline raiding - that a member of the defending clan itself is
online and within 250 m of the Ward (
RaidDefenderPresenceRadius). An ally standing there does not count. - Both clans get a centre-screen raid announcement. Nobody else is told.
- For 30 minutes (
RaidMaxDurationSeconds) the attacking clan may break that base- only that base. Every weapon works, at a multiplier for the kind of attack and the material hit (see Raid damage below): ordinary weapons do a tenth of their damage, fire arrows are strong against wood, war hammers against wood and stone, and the battering ram and catapult against everything. The Ward itself cannot be broken.
- The Ward is captured by holding its 50 m zone (
RaidCaptureRadius). Every living player there counts as one for their side: the attacking clan and any clan allied only to it count as attackers; the defending clan and any clan allied only to it as defenders; a clan allied to both, or to neither, does not count. More attackers than defenders pushes the capture up; more defenders winds it back down at the same rate; equal numbers freeze it (contested); an empty zone freezes it too (paused). Numbers decide the direction, not the speed: a full capture is 5 minutes of control (WardCaptureSeconds) whether one attacker holds the zone or ten. - Captured within the 30 minutes - the attackers win. The Ward, its territory and everything in it become theirs; the old owners are outsiders there, their trade posts inside it are lost, and every personal bed claim within the claim radius is cleared - the beds stay, but belong to nobody.
- Not captured when the 30 minutes run out - the defenders win, even at 99%. Raid damage stops at once and the base is protected again.
When a clan is disbanded, all its Clan Wards are taken down and its base claims released; the buildings and everything inside stay where they are.
While a raid is on, the Clan Ward it is fought over cannot be taken down with the hammer, and the two clans cannot make an alliance until it is over.
Both clans then get a cooldown (RaidCooldownSeconds, default 2 h).
Respawning. After a death the game's map opens on where you fell with every bed you have claimed marked on it. Pick a bed, or the default spawn, which is always there. The server checks the bed as you choose it - it must still stand and still be yours - and the game's own bed check refuses a bed that is no longer yours, so a bed cleared by a capture can never put you back inside that base.
5. Alliances and trade routes
Two clan leaders agree an alliance on the Diplomacy tab. Allies can then
open a trade route between their trade posts — chests each clan registers
as hubs (up to MaxTradePosts, default 3). Only a chest a player built can be one - not a
grave, and not a chest found in a dungeon or crypt. Register one by opening the chest and pressing Set trade post in its window,
which then asks for a name; press it again to release it. Posts are listed with
their names on the panel's Trade tab, each with a Remove button.
A post is locked while an offer or a caravan uses it; the clan's other posts stay free. A post whose chest is destroyed or taken down is unregistered, and the clan is told. Post names are unique across all clans, and a chest can only be one post.
Starting a trade. Open a registered post and press Initiate trade, or use the Initiate trade button on that post's row in the Trade tab. You choose the ally after starting, then pick goods out of two real chest grids — yours and theirs. The ally's grid shows what they genuinely hold: the server reads their chests straight from the ZDOs, so nobody needs to be standing near them.
Each trade records the two chests it went through, so caravan time is measured between those posts rather than the clans' closest pair, and each caravan unloads into the chest it was sent to.
Counter-offers. A recipient can answer with different terms. Both sets of terms are shown side by side, and the original proposer accepts or rejects. Escrow never moves during a counter — the proposer's goods stay put and the counter-party pays nothing until the terms are agreed.
Trading over a route:
[WOLF]composes an offer from one of their posts: what they send, what they want, and which of[BEAR]'s posts it goes to. Wolf's goods leave their chest straight away and are held in escrow.[BEAR]accepts, declines or counters on their Trade tab; accepting takes their side of the deal out of their trade post. Nobody has to stand at a post to trade: a chest that is not loaded where the player is gets emptied by the server itself.- Two caravans set off. Travel time scales with the real distance between the two trade posts (default 12 m/s, clamped to 30 s … 30 min).
- When a caravan's timer runs out it unloads itself into its destination post — nobody has to be there, and there is nothing to claim. It is all or nothing: if the whole load fits it goes in and the caravan shows Delivered; if it does not, nothing is moved, the caravan shows Waiting for space, and the server keeps the goods and retries every few seconds until there is room. Goods are never dropped or partly delivered. If the destination chest is gone, the caravan unloads into another of the clan's posts.
Cancelling, declining, a broken alliance, or a client that fails to hand over the goods all refund escrowed items as a returning caravan, which unloads the same way — nothing is destroyed.
6. The map: Normal Map and War Map
Valheim's own map gains a [Normal Map] [War Map] switch at the top. It is one map with two ways of showing it — switching never closes it, moves you, or touches the fog of war.
- Normal Map is the vanilla exploration map: terrain, fog, your own pins, and your clanmates' live positions. No Clan Wars intelligence appears on it.
- War Map shows only Clan Wars information: your clan's Wards and territory, enemy Wards your Ravens have found, your clanmates, Scout Raven flights, and any raid under way with its clock and capture progress. Ordinary pins are hidden.
Player locations. Location sharing is always on and cannot be switched off — the map's "visible to other players" box is not shown at all — but a live position only ever reaches members of the same clan. Enemies, allies and clanless players never see you, and you never see them, on either map and during raids too. The server sends each player a list with positions for their own clanmates only, so the rest is not hidden on your screen: it is never sent. Joining, leaving or being kicked changes who sees whom at once.
Scout Ravens. Each clan has 3 (RavensPerClan). They are one of two ways to
discover a base; the other is simply getting within 200 m of it. On the War Map an officer or
the leader clicks a spot, picks which of the clan's Wards the Raven flies from, and picks
how much ground it scouts around the spot: 250 m, 500 m or 1 km (RavenScoutRadii).
The Raven flies there and back at 1 km per 5 minutes (RavenSecondsPerKm), so a spot
1 km away is a 10 minute round trip. It searches only that circle - not the land it
flies over - and brings back every Clan Ward standing in it, enemy or allied; a Ward the
clan already knows is not added twice. Members can watch Ravens; only officers and the
leader can send them.
A flight costs feathers, taken from the Ward it leaves from: 10 per kilometre to the
spot (RavenFeatherCostPerKm), times 1, 1.25 or 1.5 for the three radii
(RavenRadiusCostMultipliers), rounded up. Each Clan Ward has a five-slot store that
takes only feathers (RavenFeatherItem): use the Ward to open it. Only the Ward's own
clan can open it, and the War Map shows how many feathers each Ward holds and what a
flight will cost before it is sent.
Ward names. Every Clan Ward has a name, unique across all clans - WOLF Ward 1,
WOLF Ward 2 and so on to begin with - shown on the War Map, the Ward's hover text and the
raid log. Officers rename them on the Raids tab. A captured Ward takes its new owners' name.
Ravens find Wards and nothing else: no players, no defenders, no buildings, no terrain. A found Ward's marker can sit in fog you have never explored — the fog stays. To learn what the base looks like, go there.
Raids on the War Map. A raid under way shows the base's 150 m claim and, inside it, the 50 m capture zone filling like a stopwatch as the capture rises and unwinding as the defenders reclaim it. Its colour is who holds the zone as you see it: green for your side, red for theirs, white when contested. Players at the Ward also get the capture, the head count on each side and the raid clock at the top of the screen; the head count is never shown anywhere else.
Raiding from the War Map. Select a found enemy Ward to see its clan, how far it is from your Ward and its raid status — Defenders Present – Raid Available or Raid Unavailable — and an officer or the leader can press Initiate Raid. Selecting a Ward never starts anything by itself. The status is yes or no only: it never says who, how many or where. A raid in progress does not show enemy players on the map either.
Installing
Requires BepInEx for Valheim (BepInExPack Valheim 5.4.x).
- Build (see below) or take
ClanWars.dllfrom a release. - Drop
ClanWars.dllinto<Valheim>/BepInEx/plugins/. - Do the same on the dedicated server if you run one.
Using Thunderstore Mod Manager or r2modman? They launch the game against a profile BepInEx (under
%APPDATA%/Thunderstore Mod Manager/DataFolder/Valheim/ profiles/<profile>/BepInEx/), not the one in the game folder — a DLL dropped in the game folder is silently ignored. Either import the mod through the manager ("Import local mod", using the Thunderstore-format zip inpackage/) or copy the DLL into that profile'spluginsfolder. Don't do both: two copies with the same plugin GUID makes BepInEx skip one arbitrarily.
The mod must be installed on the server and on every client:
- the server owns the clan database and decides every command;
- clients need it to see tags and to have friendly fire applied.
A client without the mod can still connect (nothing in the network protocol changes), but it will not honour clan protection when it is the one applying damage — install it everywhere on a PvP server.
Where data lives
| What | Where |
|---|---|
| Settings | BepInEx/config/ClanWarsConfig.cfg |
| Clan database | BepInEx/ClanWars/<worldname>.clans.json (+ .bak) |
The database sits outside config/ on purpose: it is a record of who owns what,
not a setting anyone edits, and keeping it out stops it appearing in mod-manager
config editors next to the real settings. It is written atomically with a backup
alongside, and only ever together with the world: whenever the game saves the world
(autosave, logging out, the save command) the clan database is written at the same
moment. A world closed without saving — a crash, the window closed — loses its clan
changes along with everything else, so the clan records always match the world file
they sit beside: the same Wards, the same trade post chests, the same goods in escrow.
Back the two up together.
Both locations are relative to whichever BepInEx is actually running. With a
mod manager that is the profile folder, not the one inside the game directory.
Older installs are migrated on first boot: the database moves out of config/,
and the GUID-named com.clanwars.valheim.cfg is retired to .migrated once its
values are copied across.
Building
Requires the .NET SDK (tested with 10.0) and a Valheim install for reference assemblies. The build only reads from the game folder — it never writes to it.
dotnet build src/ClanWars/ClanWars.csproj -c Release
Output: dist/ClanWars.dll.
If Valheim is not in the default Steam location:
dotnet build src/ClanWars/ClanWars.csproj -c Release -p:ValheimDir="D:\Games\Valheim"
or set the VALHEIM_DIR environment variable.
Odin-Sent Relics
Ten unique trinkets, five Military and five Economic, each tied to a Norse god.
When one of the first five bosses dies, the whole server is told, the defeat goes into the
boss history, and - unless that boss sent relics within the last 3 hours
(BossRelicRewardCooldownSeconds, per boss) - Odin sends its Military and its Economic
relic to two separate places in the next biome of the progression:
| Boss | Military | Economic | Lands in | From the world centre |
|---|---|---|---|---|
| Eikthyr | Ullr | Víðarr | Black Forest | 1-2 km |
| The Elder | Loki | Gefjon | Swamp | 2-3 km |
| Bonemass | Týr | Jörð | Mountains | 3-4 km |
| Moder | Thor | Njörðr | Plains | 4-5 km |
| Yagluth | Freyja | Frigg | Mistlands | 5-6 km |
All of it is configurable per boss ([OdinRelics.Bosses.*]). Only one of each relic exists:
a relic already in the world - protected, on the ground, carried, stored, anywhere - is not
sent again, and nothing is sent in its place (SubstituteUnavailableRelics). Relics land
on dry, level ground of the right biome, spread through the band, at least 750 m apart,
never within 500 m of a Clan Ward (MinimumRelicDistanceFromClanWard, which has nothing to
do with how far Wards stand from each other), away from traders, the world's own locations,
players and other relics; if the biome is nowhere usable in the band, the nearest usable
ground of the same biome is used - never another biome. Relics need gentle ground.
It falls from the sky. A relic arrives as a meteor: it falls from high above its landing spot trailing fire and smoke, and strikes with a flash, a fireball, a ring of dust, a shockwave and a boom - heard later the further away you are. Everyone sees it, however far off, drawn at the spot itself and bright enough to show through mist. Everything standing within 10 m of the impact is destroyed - trees, stumps, rocks, bushes, plants, buildings - except people and creatures, dropped items, tombstones, anything still holding items, ships, carts, portals, Clan Wards and relics. Trees and rocks only exist once someone comes near, so where the land isn't made yet the impact claims it the moment it is. It leaves a crater - a metre deep at most, following the lie of the land and never below the water line - painted bare earth under a patch of scorched ground that fades into the land around it; smoke rises and embers glow there for a while after. The scorched crater stays after the relic is gone.
Each relic is a hand-forged necklace: a leather cord and a pendant of its own - Ullr a
silver bow and arrow, Loki a coiled iron serpent, Týr a shield bearing Tiwaz over a short
sword, Thor an iron Mjölnir with a bronze knot, Freyja amber set in gold, Víðarr a carved
oak, Gefjon a bronze-eared wheat sheaf, Jörð a stone caged in iron, Njörðr a bronze
longship, Frigg a gabled house with an amber hearth. The same pendant is its inventory icon,
the item lying on the ground, the relic in its shrine, and - worn - a necklace other players
can see round your neck; it comes off when you take the relic off, die or put it away. While
Odin guards it, it hangs in a soft
golden glow that a ray of light from the sky melts into, inside a dark bubble like the
trader's; the bubble fades over the last five minutes of protection and is gone when the
timer reaches zero. The War Map shows only an area around it (RelicBubbleRadius), with the
relic somewhere inside, not the spot.
Sound. Close to a guarded relic a low, choir-like hum breathes and wavers - very quiet,
heard only within a few metres. The first time a relic is claimed after Odin lets it go,
Odin speaks where it happened, heard by everyone nearby: that relic's recording,
Odin_<Relic>.ogg (or .wav / .mp3, e.g. Odin_Ullr.ogg) in the mod's audio folder -
Odin.ogg stands in for any relic without its own - played a little deeper, in a vast
reverb with a faint echo, over a swelling drone. Without recordings only the drone swells.
Odin's protection. A new relic hangs inside Odin's bubble for 6 hours (Military) or 3 hours (Economic), counted from the moment it lands and kept across restarts (a new time in the config applies to relics already guarded, too). The bubble is solid - nobody walks through it - and while it lasts there is no item there at all, only Odin's shrine, so nothing can take, move or break the relic. The bubble fades over the last five minutes; when the timer ends the real relic is laid down and everyone is told. It never despawns.
Always on the War Map. Every relic is on everyone's War Map from the moment it lands until it is destroyed - protected, lying there, carried, worn, in a chest, cart, ship or tombstone, on a stand - following whoever or whatever holds it. Only its position is shown, over fog that stays fog; it is on the HUD minimap too, and never on the normal map. The clan panel's Odin Relics tab lists every relic's state, protection countdowns (HH:MM:SS), each boss's configured progression and reward cooldown, and the boss history, with View on War Map to jump to a relic.
Wearing one. A relic goes in the trinket slot and works only while worn; one at a time
(MaxEquippedRelicsPerPlayer) - putting on another swaps out the one worn. A player can carry
at most 2 relics, the worn one included (MaxCarriedRelicsPerPlayer): a relic past that
cannot be picked up or taken out of a chest, and stays behind on a take-all. Worn, it hangs round the
neck like the game's own bronze trinket - the same chain the game fits to every body, dressed
in the relic's leather cord, with the relic's own pendant in place of the trinket's. The server tracks every relic, so only the real one can be
worn: copies with the wrong mark, duplicates and relics the world has no record of are
taken back.
| Relic | Effects (defaults, all in [OdinRelics.Effects]) |
|---|---|
| Ullr | +25% bow damage, 50% chance to keep an arrow, +15% speed in light armour |
| Loki | +25% knife damage, +20% speed unless in heavy armour, -30% sneak stamina |
| Týr | +20% sword damage, +20% block power, -25% block and parry stamina |
| Thor | +25% blunt damage, +20% stagger, +15% physical resistance in heavy armour |
| Freyja | +20% magic damage, -20% eitr cost, +20% eitr regeneration |
| Víðarr | +30% wood yield, +25% axe damage to trees, -25% axe wear |
| Gefjon | +25% cultivated crop yield, 50% chance to keep the seed, -25% cultivator stamina |
| Jörð | +25% pickaxe damage to rocks and ore, +20% mining yield, -20% pickaxe stamina |
| Njörðr | 15% off at traders, +25% on sales, +20% sailing speed while steering |
| Frigg | 20% of building materials saved (taking a piece down returns only what it cost), +25% building reach, 15% of crafting materials saved |
Light and heavy armour are judged by weight: helmet, chest, legs and cape together under
20 kg is light armour, 20 kg or more is heavy (HeavyArmorWeightThreshold). Every effect is a
share from 0 to 1 in the config (0.25 = 25%), shown as a percentage in game.
Loose relics. A relic lying loose in the world - dropped, left behind, laid down when its protection ends - never lies on the ground: it hovers above the ground or water in Odin's light, glowing and humming as a guarded relic does, only without the bubble and the timer, and is picked up where it hovers.
Leaving and dying. A relic stays in this world: a player who logs out with one leaves it
where they stood, and a dying holder's relic goes into the tombstone - or onto the ground if
the world keeps or deletes items on death. It is not given back on respawn. A relic is
destroyed only when it is really gone - obliterated, say - and found nowhere for 2 minutes
(RelicMissingGraceSeconds); then everyone is told, and its boss can send it again.
Limits worth knowing. Valheim's inventories and combat live on the players' own machines, so a modified client can always cheat its own effects; what the server holds is identity, location, protection, uniqueness and destruction. A boss defeat is counted from the boss's object leaving the world together with proof it died (its health at zero, its own defeat key being set, or its corpse appearing) - the game does not tell the server who landed the killing blow, so the history lists who was present, not who killed it. An item stand keeps only which relic sits on it, not its mark; the one copy that comes off it is re-marked by the server.
Also in the clan panel and on the map
- Map pins. The War Map marks everything with carved Norse pins, tinted by whose it is: Wards (ours, allied, enemy), raids under way, Scout Ravens in flight, trade posts, caravans on their way, and Military and Economic relics - each its own shape, with a rune ring for a relic Odin guards and a jagged ring for a contested capture. A key sits in the corner. Relics a player carries or wears sit in a row just above that player's arrow, without labels; click any one of them to see it in the panel.
- Live events on the minimap. Relics, your clan's raids, its Ravens in flight and its caravans on the road show on the HUD minimap with the same pins - only what the War Map already shows you; Wards and trade posts stay on the War Map, and the normal map shows no Clan Wars markers at all.
- Open Clan UI sits beside your inventory: it closes the inventory and opens the panel.
- Trade Log tab. Offers sent and received, counters, trades agreed, declines, cancellations, deliveries, returned goods, routes opened and closed, and lost posts, newest first. A delivered caravan stays on the Trade tab for 15 minutes, then only here.
- Close route next to New offer ends trade with that ally until a route is opened again; open offers between the two clans are called off and their goods go home.
- A declined, cancelled or called-off offer's goods come home as a caravan marked with why.
- Raids tab: the raid under way, a raid log of every attack and defence with the time, the other clan, the Ward and who won, the clan's named Wards, and the raid rules.
- While a raid is on, the clans in it and their allies cannot leave, kick or disband, and the two clans cannot ally. Nobody can take the raided Ward down with the hammer, and its owners cannot break it - but the attackers can destroy it, which ends the raid in their favour and leaves the land unclaimed.
- Workbenches and crafting stations can only be used by the clan that owns them - the clan whose base they stand in, or else the builder's clan - and its allies, raid or not.
- Beds inside a Clan Ward's claim can only be claimed by that clan. A bed someone already holds stays theirs.
- Clan Wards must stand at least 200 m from the world spawn (
WardMinimumDistanceFromSpawn). - Fresh characters only. A character joining for the first time must be fresh - nothing beyond the starting rag tunic and torch, no forsaken power, no trained skills - and a character that has played here may not come back with gear, a better piece, a forsaken power or higher skills than it left with. Either is turned away while it connects, before the world loads, with the reason on the main menu; nothing on the character is changed. Characters already of the world when this arrived are kept as they are. Players must run the same Clan Wars version as the server - a game without it is turned away the same way, as Valheim Plus checks its own version.
- Fire arrows set wooden pieces - walls, fortifications, furniture - alight, with the
game's own fire, wherever they are allowed to do damage. The fire burns only the piece
hit; with
FireSpreadson it reaches out 0.1 m every 5 seconds (FireSpreadMetres,FireSpreadIntervalSeconds) and every wooden piece it reaches catches too. Rain puts it out. - Map pings (middle click) are seen only by your own clan. The War Map shows only the key that means something there, and the "visible to other players" box is gone, panel and all. The game's own pin toolbar is hidden on the War Map, which has its own legend, and is back on the Normal Map.
Configuration
BepInEx/config/ClanWarsConfig.cfg, created on first run.
The server's copy is the one that counts. Combat and structure damage are judged on each client, so the rule-affecting settings below are pushed to every client in the snapshot and clients enforce with the server's numbers, not their own file. A client's own values only apply in single-player or before a server answers. Edit the server's config, restart the world, and every connected player picks up the change.
Interface settings (hotkey, name plates) stay local to each player, as they should.
Every setting in the file carries a short description. Times are in seconds, distances
in metres, and shares - bonuses, chances, damage multipliers - are decimals from 0 to 1
(0.25 = 25%). Settings the mod no longer uses are removed from the file on the next start;
old minute-based settings are converted to seconds once.
| Key | Default | Meaning |
|---|---|---|
Combat.ClanPvpEnabled |
true |
master switch for all combat changes |
Combat.ProtectAllies |
true |
allied clans cannot hurt each other |
Combat.ClanlessUsesVanillaPvp |
true |
clanless players still use the vanilla PvP toggle |
Combat.ForcePvpFlagOn |
true |
report PvP as on so cross-clan hits land without the toggle |
Combat.PvpDamageMultiplier |
1 |
damage players deal to each other, fire, poison and spirit over time included; applied after armour and resistances (2 = double, 0 = none) |
Clans.MinTagLength / MaxTagLength |
2 / 5 |
tag length limits |
Clans.MaxClanSize |
4 |
players per clan, every rank counted; 0 = unlimited |
Clans.ShowTagInNamePlate |
true |
[TAG] on name plates |
Clans.ShowTagInChat |
true |
[TAG] in front of chat messages |
Interface.UiHotkey |
F6 |
key that opens the clan panel |
Trade.MaxTradePosts |
3 |
how many chests a clan may register as trade posts |
Trade.CaravanSecondsPerKm |
300 |
seconds per km between the two posts (1 km in 5 minutes) |
Trade.DeliveredCaravanShownSeconds |
900 |
seconds a delivered caravan stays on the Trade tab |
Trade.MaxAmountPerStack |
9999 |
quantity cap per item type |
Trade.EscrowTimeoutSeconds |
60 |
how long the server waits for a client to hand goods over |
Trade.DeliveryRetryIntervalSeconds |
5 |
how often a caravan waiting for space tries again |
Raiding.RaidingEnabled |
true |
master switch for raids |
Raiding.WardClaimRadius |
150 |
metres of base a Clan Ward claims |
Raiding.MinClanWards |
3 |
Clan Wards a clan starts with and the lowest its limit falls; +1 per Ward captured, −1 per Ward lost, no ceiling; 0 = no limit |
Raiding.FriendlyWardMinimumDistance |
305 |
metres between two Clan Wards of the same clan |
Raiding.OtherClanWardMinimumDistance |
505 |
metres between Clan Wards of different clans |
Raiding.WardMinimumDistanceFromSpawn |
200 |
metres between a Clan Ward and the world spawn |
Raiding.RaidDefenderPresenceRadius |
250 |
a defending clan member must be online and this close to start a raid |
Raiding.RaidMaxDurationSeconds |
1800 |
the Ward must be captured within this, or the defenders win |
Raiding.WardCaptureSeconds |
300 |
seconds of control for a full capture (and a full reclaim) |
Raiding.RaidCaptureRadius |
50 |
metres of the capture zone around a raided Ward |
Raiding.RaidCooldownSeconds |
7200 |
before a clan can raid or be raided again |
Discovery.PlayerWardDiscoveryRadius |
200 |
a clan member this close to an enemy Ward discovers it |
Discovery.PlayerWardDiscoveryCheckIntervalSeconds |
5 |
how often that is checked |
Ravens.RavensPerClan |
3 |
Scout Ravens each clan owns |
Ravens.RavenSecondsPerKm |
300 |
seconds per km, each way (1 km in 5 minutes) |
Ravens.RavenScoutRadii |
250,500,1000 |
the scout radius choices, metres |
Ravens.RavenRadiusCostMultipliers |
1,1.25,1.5 |
feather multiplier for each radius |
Ravens.RavenFeatherCostPerKm |
10 |
feathers per km from the Ward to the spot; 0 = free |
Ravens.RavenFeatherItem |
Feathers |
what a flight costs, and all the Ward's store accepts |
Fire.FireSpreads |
false |
fire lit by a fire arrow spreads to nearby wooden pieces |
Fire.FireSpreadMetres / FireSpreadIntervalSeconds |
0.1 / 5 |
how far a spreading fire reaches out each step, and how often |
FreshStart.FreshCharactersRequired |
true |
first-time characters must be fresh, or they are turned away |
FreshStart.BindCharactersToServer |
true |
returning characters may not bring gear or skills gained elsewhere |
FreshStart.FreshMaxSkillLevel |
1 |
highest skill level a fresh character may have |
FreshStart.FreshStarterItems |
ArmorRagsChest,Torch |
the starting kit a fresh character may carry, one of each |
FreshStart.ReturnSkillTolerance / ReturnItemTolerance |
0.5 / 20 |
unseen skill levels and materials a returning character may bring (crash window) |
FreshStart.RequireClanWarsMod |
true |
players must run the same Clan Wars version |
FreshStart.ExemptCharacters |
(empty) | character names never checked, for admins and testing |
Server.RaidLogSize / TradeLogSize |
200 / 150 |
raid log entries kept, trade log lines kept per clan |
Server.VerboseLogging |
false |
extra logging |
The raid rules use key names of their own, so an existing config picks up the defaults above rather than older raid settings.
Raid damage
[Raiding.Damage] and its sub-sections set how hard each kind of attack hits each kind
of structure during a raid, as a share of Valheim's own damage from 0 to 1 (1 = vanilla,
0.1 = 10%). [Raiding.Damage.FireArrow] Wood is the fire damage multiplier for wooden
structures and furniture: it scales both the arrow and the fire it lights.
| Attack | Wood | Ashwood | Stone | Black Marble | Grausten / reinforced |
|---|---|---|---|---|---|
Ordinary weapons (GeneralWeaponStructureDamageMultiplier) |
0.1 | 0.1 | 0.1 | 0.1 | 0.1 |
Fire arrows (Raiding.Damage.FireArrow) |
1 | 0.25 | 0.05 | 0.05 | 0.05 |
War hammers (Raiding.Damage.WarHammer) |
1 | 1 | 1 | 0.75 | 0.5 |
Battering ram (Raiding.Damage.BatteringRam) |
1 | 1 | 1 | 1 | 1 |
Catapult (Raiding.Damage.Catapult) |
1 | 1 | 1 | 1 | 1 |
The ram and catapult sit at vanilla because their vanilla damage is already far beyond
any hand weapon. FurnitureDamageMultiplier (0.5) applies on top for furniture.
Materials come from Valheim's own building material: wood, core wood and ancient wood
are Wood; Ashlands timber is Ashwood; stone and ice are Stone; Mistlands
marble is Black Marble; iron and grausten are Grausten / reinforced. The
WoodPrefabs ... HeavyPrefabs lists move individual pieces between classes, for
modded or ambiguous pieces. War hammers are every two-handed Clubs weapon, plus
ExtraWarHammerPrefabs.
Older configs are upgraded once: settings still at an old default (clan size 20, claim
100 m, capture 12 m) move to the new ones, the old breaker-weapon list becomes
ExtraWarHammerPrefabs, and retired keys are removed.
How it works
Combat. In 1.0.7 the vanilla PvP gate sits in Character.RPC_Damage, with
early-outs on the attacker's side in Attack and Projectile. The mod:
- postfixes
Player.IsPVPEnabledto reporttrue, so cross-clan hits are not discarded before they are evaluated (all real decisions happen below); - prefixes
Character.Damageso a friendly hit never leaves the attacker's client; - prefixes
Character.RPC_Damageso the victim's own client re-checks authoritatively — a client with stale or tampered clan data still cannot hurt a clanmate; - postfixes
Projectile.IsValidTargetso arrows pass through friends.
Interface. The panel is built from Unity UI primitives at runtime, then styled
from assets harvested off the live game UI: body font from the inventory labels,
heading font from the rune-stone viewer, the wood panel sprite from the inventory
or trader window, and the button prefab cloned from the craft button (which is why
buttons keep their hover art and click sound). Every lookup is optional — if an
asset cannot be found the panel falls back to plain colours rather than failing to
open. Input blocking rides on Player.TakeInput, the cursor on
GameCamera.UpdateMouseCapture + ZCursor, both matching how vanilla windows do it.
Configuration. Rule-affecting settings ride in the public snapshot as a
SyncConfig, so every client judges damage with the server's numbers. Clients fall
back to their own file only until the first snapshot arrives. Damage scaling is
applied once, on the attacker's side, via HitData.ApplyModifier before the hit is
sent — applying it again on the owner would double it.
Capture. Ward capture is ticked by the server from where each player's living character actually is - its own networked object, which is gone or flagged dead while they are dead - never from anything a client reports. Progress is seconds of control, advanced by real elapsed time; sides are worked out from the alliances as they stand each tick. The server decides the outcome and rewrites the captured Ward's creator and permitted list, and clears the bed claims inside the base.
Bases and raiding. The server finds Clan Wards by reading ZDOs and keeps claims in
its database. Each client is sent its own clan's claims and those near it, never the
full list. Territory is enforced through PrivateArea.CheckAccess. Structure damage is
checked on both ends, but the raid multiplier is applied only on the side that receives
the hit (WearNTear.RPC_Damage), so an attacking client that skips the check gains
nothing. Material and attack type are each decided in one place.
Stable identity. Valheim gives every object a new id each time a world loads. The mod writes a permanent tag into each Clan Ward and trade-post chest and, after a load, matches its records back to the objects by that tag (records saved before tags existed are matched once by position), then updates every reference in one pass.
Networking. Four routed RPCs (ClanWars_Register, _Command, _Response,
_Sync) carrying JSON. Clients send commands; the server validates everything and
broadcasts a small public snapshot (clans, members, alliances, who is online) that
clients use for the combat rules, name plates and chat tags. Members additionally
receive a private structured view of their own clan's diplomacy and trade, which is
what the panel lays out — coalesced to at most one push per second. Clients never
mutate clan state.
Map privacy. ZNet.SendPlayerList is replaced on the server: it still builds the
vanilla list, then writes a separate copy per peer with the game's own
WritePlayerInfo, keeping positions only for the viewer's clanmates and taking them
from the server's record of each peer rather than the player's visibility setting.
Clan bases are not in the public snapshot either: each client is sent its own clan's
Wards and those near where it is, for the territory rules, and nothing else.
Scout Ravens. A flight is simulated on the server from timestamps, so a restart changes nothing. The server takes the feathers straight out of the launching Ward's store (its saved inventory, the way caravans unload into trade posts) and refuses the flight if they are not there; the circle is searched when the Raven returns.
Trade. The server holds escrow and shipments, but only a client that is standing at the chest can physically move items, so item transfer is a two-phase handshake: the server asks the client to hand goods over and only records the trade once the client confirms. If the client never confirms, the offer times out and escrow is refunded.
Receiving needs no client at all: the server writes arriving goods straight into the destination chest's ZDO. It first fits the whole load into a copy of the chest at its real size and writes only if everything fits, and it skips a chest someone has open until they close it.
Limits and notes
- Not runtime-tested. Everything is compiled against, and statically verified against, the real 1.0.7 assemblies — every patched method, parameter name and reflected field was checked to exist — but the mod has not been run in-game here, because that would mean writing to the Valheim folder. Please smoke-test on a throwaway world first.
- Tamed creatures, summons and traps belonging to a clanmate are not covered — only player-vs-player damage is filtered.
- Base protection is territorial: it covers everything inside a clan Ward's claim, whoever built it, and nothing outside one.
- Valheim lets the client that owns a piece's data apply the damage it takes, and hit data - damage, attack type, the weapon an attacker holds - is written by the attacker's client. The mod applies raid multipliers on the receiving side and distrusts siege-type claims from hand weapons, but a modified client that owns a piece, or forges its own hit data, can still misbehave.
- Respawning happens on the player's own client. The server validates the bed and the game's own bed check refuses one that is no longer the player's, but a modified client could still spawn wherever it likes, as it can in vanilla.
- As in vanilla, structure damage, building and chest access are resolved by the client that owns that piece's data. Both that client and the acting player's client enforce the rules from the server's snapshot, but a client modified to ignore them can still misbehave on data it owns. Raid starts, defender presence, Ward capture, ownership transfer and caravan delivery are decided on the server alone.
- Melee swings at a clanmate still play hit effects (the vanilla hit-detection early-out is inlined and not worth patching); no damage, stagger or knockback is applied.
- Trades move plain stackable items at quality 1 — the trade system is meant for materials, not enchanted gear.
- Clan membership is per character, not per Steam account, because Valheim's stable player id is the character id.
- The chat tag matches the speaker by character name, so two characters sharing a name would show the same tag. Name plates use the player id and are exact.
- The panel scrolls with the mouse wheel; it has no scrollbar.
- Shouting in chat still shows a spot to everyone (map pings reach only your own clan), as in vanilla — both are things a player chooses to do.

