
TerroritySmellatory
Admin-marked multiplayer territories: set the rules in a small panel, mark the ground with Infinity Hammer, and every player's game enforces them - protection, safe/war zones, no spawns or raids, sanctuary bonuses.πΊοΈ TerroritySmellatory
The jarl drove a stake into the frozen ground and said, "From here to the river is mine." Nobody argued with the stake. A great many people argued with the river. Now the river has a border you can see, a banner when you cross it, and a runic wall that turns the trolls around.
Mark the ground once. Every player's game keeps the rules.
An admin sets a territory's rules in a small panel and marks the ground with Infinity Hammer, then combines territories into any shape and nests towns inside kingdoms. The server saves them and sends them to every player.
Everyone's game then enforces them: build and chest protection for non-members, safe or war zones, no monster spawns with an optional runic barrier that holds monsters out, no raids, no skill loss, and sanctuary bonuses. Players see territories on the map and on the ground, and get an entry banner like a newly found biome.
Territories show on the map only where you have been. A territory in a part of the world you have never seen no longer paints a coloured shape over the fog and gives away where it is.
| You | It |
|---|---|
| Walk new ground, or read another player's shared map | the territory fills in with the map, cell by cell, lined up with the edge of the fog |
| Have explored half of it | the large map and the minimap show that half |
| Haven't uncovered the spot its name sits on | no name yet |
| Want the old way | turn off HideUnexploredTerritories to draw territories over the whole map |
π€ The minimap name stays on one line: a long territory name shrinks to fit the label, and only past that is it cut short with dots
| If⦠| Then⦠| |
|---|---|---|
| π | you run a server | install it on the server and every client. Protections run in each player's own game, so a player without the mod is not bound by them; the server kicks such players by default (RequireClientMod). |
| π¨ | you are an admin who marks territories | also install Infinity Hammer, with Server Devcommands and World Edit Commands as it requires. Players don't need any of them. |
| π€ | you update | update the server and its players together. |
| β©οΈ | you ever go back to an older TerroritySmellatory | a world with sub-territories cannot go back to a version that predates them: it would read every town as a territory of its own. The newer file is never saved over, so moving forward again finds it intact. |
| π | your server uses an RPC whitelist | regular players only ever receive this mod's traffic; only admins send requests. |
Like a ward, and more. The owner and members are never stopped; neither are admins, unless you say so.
| Rule | What it does |
|---|---|
| π§± Building | only members may place, remove, repair or dig β a red ghost and "private zone", as with a ward |
| πͺ Doors, chests and stations | only members may use doors, chests, portals, signs, item and armour stands, fermenters, beehives and the rest of what a ward locks |
| πΎ Harvesting | only members may pick crops, berries and other pickables β vanilla wards cannot do this |
| π° Buildings cannot be damaged | no hit harms them β creatures, fire and every player, members and admins included. Weather and support still apply |
| πͺ Doors close by themselves | off by default; a door or gate left open shuts after a delay, but never on a player standing near it |
π Read the saga β who is stopped, and how the doors behave
Building, door and harvest protection apply to everyone who is not a member. Buildings cannot be damaged applies to everyone: take a piece down with the hammer instead. Server admins are never stopped by the protections while AdminsBypassProtection is on, and admin status comes from the server's own adminlist.txt, never from your game's opinion.
Doors close by themselves is about the door, not who opened it, so members' doors close too. A door left open shuts after AutoCloseDelay (10 s), unless a player is within AutoClosePlayerClearance (3 m) of it; then the delay keeps counting and it closes as soon as they step away. The server does the closing, so every player sees it. Drawbridges and window shutters are left alone (AutoCloseExcludedPrefabs β add a modded door there to leave it open), and so are doors that need a key and one-way dungeon doors. Where territories overlap, the one that governs the door's spot decides. If you press Use on a door in the moment the server is closing it, the press is dropped: press again.
No spawns inside, and a wall of blue runes that turns monsters back at the edge.
| Rule | What it does |
|---|---|
| π« No monster spawns | no hostile world spawns, raid spawns, spawn points or nests; deer, boars, birds and fish still spawn |
| π· Runic barrier | part of No monster spawns, on by default in a new territory: a hostile creature that reaches the edge is held outside it, and a blue rune shield flares where it pushes |
| π‘οΈ Keep non-members out too | with the barrier, players who are not members are held at the edge as well; off by default |
| βοΈ No raids | a raid never picks a player standing inside |
π Read the saga β what the barrier holds, and what it lets through
Tamed creatures and peaceful animals pass; bosses are held like any monster. A monster already inside is set down just outside. It is a wall for bodies, not for arrows: a ranged monster can still shoot across it. A combined territory has one barrier, around all its ground.
Keep non-members out too holds players who are not members at the edge with the same flare, and sets one already inside (or arriving by portal) down outside. Riding, sailing and sitting are left alone. Members and the owner always pass, and so do admins while AdminsBypassProtection is on.
The flare: a blue hex-cell shield wall with carved runes, a white-hot flash where something strikes with a ripple spreading out, and a burst of glowing runes rising and dissolving. Every player sees it, worked out on their own game. Switch it off with BarrierEffects and the barrier still holds; only the show goes.
Each depends on the one above it. The barrier exists only while No monster spawns is on, and Keep non-members out too only while the barrier is. In the panel each is greyed while the one above is off, and the server clears a barrier setting whose rule is off, so a hand-edited file can't leave one on by itself.
Decide how a place feels the moment you walk into it.
| Rule | What it does |
|---|---|
| βοΈ PvP | Players choose, Forced off (a safe zone) or Forced on (a war zone). Your PvP toggle locks inside, and your own choice returns when you leave |
| π―οΈ Sanctuary effect | a status effect named after the territory: health, stamina and eitr regen, bonus carry weight and bonus armour |
| π No skill loss on death | dying inside doesn't lower your skills |
| π― Entry and exit banner | the territory's name as the big title, like a new biome, with your own text beneath and the discovery sound the first time; leaving shows "Leaving Hrafnborg", or your own text |
π Read the saga β banners that never spam
The entry text can name the territory and its owner ({name} and {owner} are filled in). A small gem on the banner's lower braid shows the PvP state: green where PvP is forced off, red where it is forced on, none where players keep their own choice. The simple banner style and the goodbye show the same state as one coloured line, and a forced zone names its state on every entry.
No spam at an edge. You count as inside until you are 3 m past it, re-entering within 90 seconds is silent, and dying inside is not leaving. Prefer one quiet line? Set EntryBannerStyle to Simple.
Players see where the border runs, on the map and under their feet.
| Rule | What it does |
|---|---|
| πΊοΈ Show on the map | the territory's real outline and name on the large map and the minimap β a combined territory as one shape β only over ground you have uncovered |
| π·οΈ Name only | with Show on the map: just the name, no outline or tint β for a continent or region that would otherwise wash the whole map in one colour |
| π§ Name above the minimap | while you are inside, its name replaces the biome name, on one line |
| γ°οΈ Show its border | players near the edge see the border on the ground |
π Read the saga β borders and very big territories
The ground border draws exactly the stretch within BorderRange of you: a small territory shows its whole ring, and a big one shows a stretch that grows as you walk up. It runs only along the outside edge of a combined territory. A territory whose edges add up to more than 100 km gets no border on the ground, and keeps its name on the map. When borders show at all is yours to choose with ShowBorders.
Circles, squares and rectangles, combined into one territory. An L-shaped keep, a road with a market at its end, a ring of towers.
| You | It |
|---|---|
| Territory combine (hammer tool) | place it inside the territory to keep, then within 15 seconds inside the one to join into it; placing in the first again cancels |
| Place β Ground β Combine β Join into this (panel) | the same, without the hammer (click twice) |
terr_combine <into> <from> |
the same, from the console |
| Place β Ground while editing | lists the parts: Move one with the hammer, Split off one into its own territory, Remove one, Add ground with the hammer, or Add a circle here |
π Read the saga β one territory everywhere
Protections, PvP, Sanctuary and the banner treat all the parts as one area: walking from one part into another is not leaving. The map draws one outline round the whole shape, with no seams where parts overlap. The territory you combine into keeps its name, rules and owner; the other's owner and members become its members, and the other's own name and rules are dropped. Split off and Remove ask for a second click.
Overlaps. Where two separate territories overlap, the smaller one rules its own ground (its real covered area, overlaps counted once), so a public market drawn inside a protected kingdom works with no setup. Priority lets the bigger one win when you want that instead.
A continent with its towns. Each town says only what makes it different.
| You | It |
|---|---|
| Mark a territory inside another | it becomes a sub-territory: it starts as a copy of the big one's settings and keeps following them |
| Change one setting on the town | that setting becomes its own (own); everything else still follows |
| Click own | that setting follows again; Follow all of β¦ takes everything back (click twice) |
| Change the continent | every town that follows it changes too |
| Delete the continent | each town keeps the rules it had and moves up a level; Delete with everything inside takes them too |
π Read the saga β what follows, and how nesting feels to a player
What follows: every rule, PvP, priority, colour, the owner and members (so the continent's members are members of its towns until a town sets its own people), the Sanctuary numbers, and the entry and exit texts. A sub-territory's name, ground and history are always its own. The Members tab says whose people they are; Set its own list copies the parent's and makes them the town's own.
In the panel, a new territory's Inside row says Automatic: the territory it is marked in, or none in open country. Change on that row puts an existing territory inside another or takes it out. The All tab lists territories as a tree, and the Here card names the chain (Inside: Hrafnborg > Svartland).
A sub-territory governs its own ground over everything it sits inside, whatever their sizes and priorities say. Sub-territories can have their own, up to eight levels: a continent, a region, a town, a district. Two territories that merely overlap, with no link, still follow "the smaller one governs its ground".
- Banners. Walking into a town gives the town's banner and no goodbye to the continent. Walking out says goodbye to the town and doesn't announce the continent again, because you never left it. A continent you haven't been told about this session (you logged in inside a town) is announced the first time you step out.
- The runic barrier guards only the ground its territory governs. A town inside a barrier territory isn't sealed in: a visitor who logs in there or arrives by portal stays put, and an arena town inside a monster-free kingdom keeps its monsters. Something walking out of the town onto the barrier's ground is held at the town's edge; something found on that ground is taken out by the nearest way out of the outer edge, never into the town.
- The minimap shows the town's name inside the town and the continent's everywhere else.
- The map. Give a continent Name only, or its tint colours the whole map.
- Size.
MaxRadiusgoes up to 100 km, so a continent can be marked in the game from a few big parts.
First ten minutes (admin): install on the server and every client, plus Infinity Hammer for yourself β Home β on Rules, name it and pick its rules β on Members, pick an owner β Place β Pick up the hammer to mark a new territory β size it and place β walk out and back in for the banner.
Players: Home (or terr) opens the panel. Here shows where you are, whose land it is and what applies to you; All lists every territory with its distance.
| Key | Command | ||
|---|---|---|---|
| Home | the panel | terr |
open or close the panel |
terr_whoami |
your player id (an admin needs it to add you while you're offline), and what you're standing in | ||
terr_list |
every territory as a tree, with ids, owners and rules | ||
terr_here [radius] |
mark a circle around you with the panel's rules | ||
terr_delete <id> [tree] |
delete one; with tree, everything inside it too |
||
terr_parent <id> <parent id> [follow] Β· terr_parent <id> none |
put a territory inside another, or back at the top level; it follows the new parent only with follow |
||
terr_combine <into> <from> |
join the second territory into the first | ||
terr_reload |
make the server re-read its territory file | ||
terr_place Β· terr_remove_at Β· terr_edit_at Β· terr_combine_at |
what the hammer tools run |
π¨ Mark a territory
- Open the panel (Home). On Rules, set the name, colour and rules. On Members, pick an owner and members from the players online, or add someone offline by player id.
- Press Place β Pick up the hammer to mark a new territory, or choose Territory from the hammer's tool menu.
- The ruler shows the area. Scroll to resize, use Infinity Hammer's shape key for circle, square or rectangle, rotate as you would a piece, and place.
The server checks you are an admin, saves the territory and sends it to everyone. The answer shows in your console, top-left and on the panel. No hammer? Use Place β Mark a circle here, or terr_here <radius>. Infinity Hammer's tools need devcommands on; the panel tells you if they are off.
π©Ή Fix a bad placement
- Territory remove (hammer tool): place it inside a territory, then again on the same one within 6 seconds. The confirmation stops a stray click deleting one.
- Territory edit (hammer tool): place it inside a territory to open the panel on it. Change its rules and members and press Save changes, or Move / reshape to mark new ground while keeping its rules.
π Set a whole world's territories from a file
Territories are saved per world in BepInEx/config/TerroritySmellatory/worlds/<world name>.json on the server, with a .bak of the previous version beside it. It is plain JSON, so you can edit it by hand, or have a world-building tool write it: a continent as one territory of a few big rectangles (its "parts"), and every town as a territory of its own with "parent" set to the continent. Write it before the world first loads, or replace it and run terr_reload (members and owners added in the game live in that file too, so replacing it replaces them). Every territory needs a unique positive "id"; an unknown key is ignored.
{
"version": 5, "worldName": "Svartland", "worldUid": 0, "nextId": 4,
"territories": [
{ "id": 1, "name": "Svartland", "shape": "Rectangle", "x": -28414, "z": 3591, "halfX": 21000, "halfZ": 9000, "yaw": 0,
"parts": [ { "shape": "Rectangle", "x": -8076, "z": -42619, "halfX": 4000, "halfZ": 3000, "yaw": 0 } ],
"color": "#3fa9ff", "pvp": "ForcedOff", "enterMessage": "You are in {name}.",
"flags": [ "BuildProtect", "StructureProtect", "NoMonsterSpawns", "NoRaids", "Announce", "ShowOnMap", "MapNameOnly" ] },
{ "id": 2, "name": "Hrafnborg", "parent": 1, "shape": "Rectangle", "x": -27100, "z": 4200, "halfX": 220, "halfZ": 180, "yaw": 0,
"parts": [ { "shape": "Rectangle", "x": -26900, "z": 4300, "halfX": 60, "halfZ": 90, "yaw": 0 } ],
"color": "#c9b458", "enterMessage": "Welcome to {name}.", "flags": { "MapNameOnly": false, "ShowBorder": true } },
{ "id": 3, "name": "Ulfheim", "parent": "Svartland", "shape": "Circle", "x": -25000, "z": 1000, "halfX": 150,
"pvp": "ForcedOn", "flags": { "BuildProtect": false, "MapNameOnly": false } }
]
}
Hrafnborg and Ulfheim are sub-territories of Svartland ("parent" is the id, or the name when that is unique in the file). Hrafnborg follows Svartland in everything it doesn't write: the same protections, PvP and owner, but its own colour and welcome, an outline on the map and a border on the ground. Ulfheim writes three things: it is a war zone with open building, drawn on the map. A key a sub-territory writes is its own even if it matches the parent's value today, so write only what should differ.
How a sub-territory's keys read. Absent means follow the parent. "flags" as a list sets all its rules; as an object ({ "BuildProtect": false, "NoRaids": true }) it sets just those and follows the rest. owner / ownerName / members are one group: write any of them and the territory has its own people ("members": [] is its own empty list), and so are healthRegen β¦ armorBonus for the Sanctuary numbers. pvp, priority, color, enterMessage and leaveMessage are one setting each. A territory with no "parent" takes a default for any missing key.
Rule names (any letter case): BuildProtect, AccessProtect, HarvestProtect, StructureProtect, NoMonsterSpawns, RunicBarrier, BarrierKeepsOutVisitors, NoRaids, NoSkillLoss, Sanctuary, AutoCloseDoors, Announce, ShowOnMap, MapNameOnly, ShowBorder. "pvp" is Unchanged, ForcedOff or ForcedOn. A rule whose prerequisite is off is cleared on load (the barrier needs No monster spawns, Keep non-members out too needs the barrier, Name only needs Show on the map) β after a sub-territory has taken what it follows.
Size. A file may hold parts up to 100 km each whatever MaxRadius says, and more parts than MaxParts and more territories than MaxTerritories; those only limit what is marked in the game.
A typo never loses territories. If the file can't be read, the server says where (line and column) and refuses to save until it is fixed, while the territories it already had stay in force. A "parent" that isn't in the file, a territory inside its own sub-territory, or a chain more than eight levels deep makes it refuse the file the same way, saying which. Older files read exactly as before. A file written by a newer version of the mod is enforced but never saved over.
Check a file before the server does. The mod's source tests build a checker that reads a file with the real reader and the server's real rules, and names what the server would take silently (a misspelt key or rule, a missing size, ground cut at 100 km, a rule cleared because its prerequisite is off, a town inside a continent with no "parent", a sub-territory writing what its parent already has): dotnet tests/bin/Release/net8.0/TerritoryTests.dll --check <file> [--at x,z]... [--tree]. --at names the territory that governs a point; --tree prints the nesting.
| The server | Each player's game | Needs it on both |
|---|---|---|
| checks who is an admin Β· saves the territories Β· sends them to everyone Β· closes the doors | enforces the protections, the barrier, PvP and the Sanctuary Β· draws the map, borders and banners | everything β a player without the mod is not bound by the rules, which is why RequireClientMod is on |
β οΈ Keep the server and players in step. Every game decides for itself which territory governs a spot, so a mismatched game could enforce different rules. A big territory list never stalls a joining player: it is sent in pieces when it needs to be.
| Mod | |
|---|---|
| Valheim 1.0 Β· BepInEx 5.4.23+ | No Jotunn. Install on the server and every client. |
| JsonDotNET (Newtonsoft) | The usual JSON dependency; the server uses it for the territory file. Mod managers install it for you. |
| Infinity Hammer 1.84+ | Admins only, to mark territories, with Server Devcommands and World Edit Commands as it requires. A soft dependency: without it everything else works. Its own default hammer and hoe tools are kept alongside the territory tools. |
| Better Continents | Compatible. Nothing assumes a world size, heights come from the game's own terrain, and territories are sent only once a joining player is fully in the world, well after Better Continents' own download. |
| Servers with RPC whitelists (such as Wonderland) | Regular players only receive this mod's traffic; only admins send requests. |
BepInEx/config/wubarrk.terroritysmellatory.cfg, or Configuration Manager (F1) in game. Territories themselves are always the server's, whatever the settings say.
π Server-synced β set on the server
| Section | Setting | What it does |
|---|---|---|
| 0 β Server Sync | LockConfiguration |
on: every 1 - Server setting is the server's for non-admins |
| 1 β Server | RequireClientMod |
kick players without the mod (on) |
| 1 β Server | AdminsBypassProtection |
admins are never stopped by protections (on) |
| 1 β Server | MaxRadius |
largest radius or half-width a placement may have, 5 m to 100 km (600) |
| 1 β Server | MaxTerritories |
territories per world (500) |
| 1 β Server | MaxParts |
parts per territory; 1 turns combining off (16) |
| 1 β Server | AutoCloseDelay |
seconds before a door closes itself, 1β600 (10) |
| 1 β Server | AutoClosePlayerClearance |
no closing while a player is this near, 0β30 m; 0 turns the check off (3) |
| 1 β Server | AutoCloseExcludedPrefabs |
door prefabs never closed (the drawbridges and window shutters) |
π₯οΈ Local to your game β yours alone
| Section | Settings |
|---|---|
| 2 β Client | PanelKey (Home) Β· PanelScale Β· ShowBorders (Off, PanelOnly, PanelOrBuilding, Always) Β· BorderRange (60) Β· ShowOnMap Β· HideUnexploredTerritories Β· MinimapTerritoryName Β· EnterLeaveBanners Β· EntryBannerStyle (Epic or Simple) Β· EntrySound (FirstEntry, EveryEntry, Off) Β· BannerCooldownSeconds (90) Β· BarrierEffects |
| 3 β Infinity Hammer | WriteHammerTool (keeps infinity_tools_terroritysmellatory.yaml; delete its first line to take it over) Β· InitialRadius (20) |
| 9 β Debug | VerboseLogging |
Needs: BepInExPack Valheim 5.4.2360 Β· JsonDotNET 13.0.4, on the server and every client. Install with a mod manager, or unzip into BepInEx/plugins. Admins who mark territories: Infinity Hammer.
- Inspired by HanonHeim's BaseTerritory.
Made by Wubarrk β ravenirongames.com. Bug reports and abuse welcome on Discord. License: MIT β use, change and share it freely, commercially too; just keep the copyright notice. Full text in LICENSE.md.