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.
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.
| Date uploaded | 2 weeks ago |
| Version | 0.3.1 |
| Download link | Wubarrk-TerroritySmellatory-0.3.1.zip |
| Downloads | 91 |
| Dependency string | Wubarrk-TerroritySmellatory-0.3.1 |
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.2350ValheimModding-JsonDotNET
Shared version 13.0.3 of Json.NET from Newtonsoft, net45 package for use in Valheim mods. Maintained by the ValheimModding team.
Preferred version: 13.0.4README
TerroritySmellatory
Admin-marked multiplayer territories for Valheim 1.0. An admin sets a territory's rules in a small panel and marks the ground with Infinity Hammer, then combines territories into any shape they like. 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 need only this mod. They see territories on the map and on the ground, get an entry banner like a newly found biome, and get whatever the admin set.
- Admins also run Infinity Hammer, and only to mark territories. Nothing a player experiences depends on it.
What a territory can do
Building, door and harvest protection apply to everyone who is not a member. The owner and members are never stopped by them, and neither are server admins (configurable). Buildings cannot be damaged applies to everyone.
The runic barrier only exists 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 it is off, and the server clears a barrier setting whose rule is off, so a hand-edited file cannot leave one switched on by itself.
| Rule | What it does |
|---|---|
| Building | Only members may place, remove, repair or dig. It works exactly like a ward: red ghost, "private zone". |
| Doors, chests & stations | Only members may use doors, chests, portals, signs, item/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. |
| Doors close by themselves | Off by default. A door or gate left open inside shuts after AutoCloseDelay (10 s), unless a player is within AutoClosePlayerClearance (3 m) of it, so nobody has a door shut in their face. Run by the server, so every player sees it close, and it applies whoever opened the door, members included. Drawbridges and window shutters are left alone, and so are doors that need a key. 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. |
| Buildings cannot be damaged | No hit harms them: creatures, fire and every player, members and admins included. Take a piece down with the hammer instead. Weather and support still apply. |
| 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, and on by default in a new territory. Monsters cannot walk in: a hostile creature that reaches the edge is held outside it, and a blue rune shield flares where it pushes. Tamed creatures and peaceful animals pass; bosses are held too. A monster already inside is set down just outside. Arrows and spit still cross it. A combined territory has one barrier, around all its ground. |
| Keep non-members out too | With the barrier: players who are not members are held at the edge as well, with the same flare, and one already inside is set down outside. Members and the owner always pass, and so do admins while AdminsBypassProtection is on. Off by default. |
| No raids | A raid never picks a player standing inside. |
| No skill loss on death | Dying inside does not lower your skills. |
| PvP | Players choose, Forced off (a safe zone) or Forced on (a war zone). The inventory toggle locks while you are inside and your own choice returns when you leave. |
| Sanctuary effect | A status effect named after the territory, with health, stamina and eitr regen multipliers, bonus carry weight and bonus armour. |
| Entry / exit banner | Entering announces the territory the way the game announces a new biome: its name as the big title, your own text beneath it ({name} and {owner} filled in), and the discovery sound the first time. Leaving shows "Leaving Hrafnborg", or your own text. The game's PvP notice shows when the territory switches your PvP. |
| Show on the map | Its real outline and name on the large map and the minimap, a combined territory as one shape. While you are inside, its name replaces the biome name above the minimap. |
| Show its border | Players near the edge see where the border runs on the ground. |
Where territories overlap, the smaller one rules its own ground, so a public market drawn inside a protected kingdom works without further setup. Priority lets the bigger one win when you want that instead.
A banner never spams 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.
Players
- Home (or
terrin the console) opens the panel. Here shows where you are, whose land it is and what applies to you. All lists every territory with its distance. terr_whoamiprints your player id. An admin needs it to add you while you are offline.
Admins: marking 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 that you are an admin (its own adminlist.txt, never your game's opinion), saves the territory and sends it to everyone. The answer appears in your console, top-left and on the panel.
Fixing a bad placement. Two more hammer tools come with it:
- Territory remove: place it inside a territory, then place it again on the same one within 6 seconds. The confirmation stops a stray click deleting one.
- Territory edit: 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 with the hammer while keeping its rules.
No hammer? Use Place → Mark a circle here, or terr_here <radius>, for a circle centred on you.
Combining territories: any shape
A territory can be made of several circles, squares and rectangles that count as one territory: an L-shaped keep, a road with a market at its end, a ring of towers. Its protections, PvP, Sanctuary and banner cover all of it, walking from one part into another is not leaving, and the map draws one outline around the whole shape.
- Territory combine (a hammer tool): place it inside the territory to keep, then within 15 seconds inside the one to join into it. Placing in the first one again cancels.
- Or in the panel: edit the territory to keep, and on Place → Ground → Combine, press Join into this beside the other one (click twice).
- Or
terr_combine <into id> <from id>.
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.
The Ground section (Place, while editing a territory) lists its parts. Move marks new ground for one part with the hammer, Split off makes a part a territory of its own with the same rules, and Remove drops a part (click twice for both). Add ground with the hammer adds a part at each placement until you press Cancel; Add a circle here adds one around you.
Infinity Hammer's tools need devcommands on (Server Devcommands). The panel tells you if they are off.
Console
| Command | |
|---|---|
terr |
Open or close the panel. |
terr_list |
Every territory, with ids, owners and rules. |
terr_here [radius] |
Mark a circle around you with the panel's rules. |
terr_delete <id> |
Delete a territory. |
terr_reload |
Make the server re-read its territory file after a hand edit. |
terr_whoami |
Your player id, and what the server says about you. |
terr_combine <into> <from> |
Join the second territory into the first. |
terr_place, terr_remove_at, terr_edit_at, terr_combine_at |
What the hammer tools run. |
Server
Territories are saved per world in BepInEx/config/TerroritySmellatory/worlds/<world>.json, with a .bak of the previous version beside it. The file is plain, readable JSON; rules are listed by name ("flags": ["BuildProtect", "NoRaids"]), a combined territory lists its extra ground under "parts", and a barrier is the names "RunicBarrier" and "BarrierKeepsOutVisitors" in the same list. You can edit it by hand and run terr_reload.
If the file cannot be read, the server says exactly where it is broken (line and column) and refuses to save until it is fixed, while the territories it already had stay in force. A typo never turns into lost territories. A file written by a newer version of the mod is enforced but never saved over. 0.3.0 writes file version 3, so a server rolled back to 0.2.x keeps the file safe the same way and will not save over it.
Configuration (wubarrk.terroritysmellatory.cfg)
| Setting | Default | |
|---|---|---|
[1 - Server] RequireClientMod |
true | Kick players without the mod. Protections run in each player's game, so a player without it is not bound by them. |
[1 - Server] AdminsBypassProtection |
true | Admins are never stopped by territory protections. |
[1 - Server] MaxRadius |
600 | Largest radius or half-width a placement may have, in metres. |
[1 - Server] MaxTerritories |
500 | Per world. |
[1 - Server] MaxParts |
16 | The most parts one territory may have. 1 turns combining off. |
[1 - Server] AutoCloseDelay |
10 | Seconds a door may stay open before a territory with Doors close by themselves closes it (1 to 600). |
[1 - Server] AutoClosePlayerClearance |
3 | A door is not closed while a player is within this many metres of it; the delay keeps counting and it closes when they step away (0 to 30, 0 turns the check off). |
[1 - Server] AutoCloseExcludedPrefabs |
piece_drawbridge,piece_drawbridge_log,Morkhalla_Drawbridge,wood_window |
Door prefab names that are never closed by themselves. Add a modded door here to leave it open. |
[2 - Client] PanelKey |
Home | |
[2 - Client] ShowBorders |
Always | Off, PanelOnly, PanelOrBuilding or Always (near an edge). |
[2 - Client] BorderRange |
60 | How close to an edge before its border shows. |
[2 - Client] ShowOnMap / EnterLeaveBanners |
true | |
[2 - Client] EntryBannerStyle |
Epic | Epic (the big title, like a new biome) or Simple (a line in the centre of the screen). |
[2 - Client] EntrySound |
FirstEntry | The discovery sound with the banner: FirstEntry (the first time each session), EveryEntry or Off. |
[2 - Client] BannerCooldownSeconds |
90 | Re-entering a territory within this time shows no banner. |
[2 - Client] MinimapTerritoryName |
true | The territory's name replaces the biome name above the minimap while you are inside. |
[2 - Client] BarrierEffects |
true | Show a runic barrier's blue flare, with its sound, where something pushes against it. The barrier holds monsters out either way. |
[3 - Infinity Hammer] WriteHammerTool |
true | Keep infinity_tools_terroritysmellatory.yaml for the hammer's tool menu. Delete its first line to take it over yourself. |
[3 - Infinity Hammer] InitialRadius |
20 | The Territory tool's starting size. |
[1 - Server] settings are locked to the server's values.
Compatibility
- Valheim 1.0, BepInEx 5.4.23+. No Jotunn. Install on the server and on every client.
- ValheimModding-JsonDotNET (Newtonsoft), the usual JSON dependency. Mod managers install it automatically; the server uses it for the territory file.
- Better Continents: compatible. Nothing here assumes a world size, heights come from the game's own (Better Continents-patched) terrain, and the network sync waits until a joining player is fully in the world, well after Better Continents' own download.
- Infinity Hammer 1.84+ (admins only), with Server Devcommands and World Edit Commands as IH requires. IH is a soft dependency: without it everything else still works.
- Servers with RPC whitelists (such as Wonderland): regular players only ever receive this mod's traffic, and only admins send requests.
Credits
By Wubarrk. Inspired by HanonHeim's BaseTerritory.
CHANGELOG
Changelog
0.3.1
Doors that close themselves. A territory can now shut the doors and gates that get left open in it.
- Doors close by themselves, a new rule on the panel's Rules tab, in the World group. Off by default, and off in every territory you already have. A door or gate left open inside a territory with the rule shuts after 10 seconds, unless a player is within 3 metres of it; then it waits, and closes as soon as they step away. Nobody has a door shut in their face.
- It is about the door, not who opened it: members' doors close too. Drawbridges and window shutters are left alone, 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, as for every other rule: a market inside a kingdom keeps its own doors as the market says.
- The server does the closing, so every player sees the door close and nothing has to be installed differently. A door far from every player is looked at once someone comes near, and its ten seconds start then. Press Use on a door in the moment it is being closed and the press is dropped for under a second; press again.
[1 - Server] AutoCloseDelay(10, from 1 to 600 seconds),AutoClosePlayerClearance(3 metres, 0 turns it off) andAutoCloseExcludedPrefabs(the drawbridges and window shutters, plus any modded door you want left open). The panel andterr_listquote the delay.- The territory file stays version 3: the rule is one more name,
"AutoCloseDoors", in the usual"flags"list. A 0.3.0 file loads unchanged, and gains no door closer.
The runic barrier now flares. In 0.3.0 the barrier held monsters out, but its shield never showed: the effect failed to build its texture and switched itself off. It is rebuilt on the same rendering as the Njord mod's runes:
- the blue hex-cell shield wall with carved runes;
- a white-hot flash where something strikes, and a ripple spreading out;
- a burst of glowing runes rising from the impact and dissolving. Every player sees it, worked out on their own game with no network traffic. If the effect ever fails to build, it says so in the log and tries again, rather than going quiet for the whole session.
- The server and every player need 0.3.1. A 0.3.0 admin's panel does not know the door rule, and would switch it off in any territory it saved a change to.
- Verified: builds against Valheim 1.0.16 with 0 warnings; every game reference and all 43 Harmony targets resolve on both the client and the dedicated server; 4,694 off-game checks. An automated run with a headless dedicated server and a headless player passes 147 checks on a plain and on a Better Continents world, and 152 with graphics on. In that run an open door shuts on time and waits for a nearby player, while doors outside the rule, drawbridges, window shutters and a market without the rule all stay open. With graphics on, the barrier's flare is caught on screen and fades away. Boots clean on a 1.0.16 dedicated server, with and without Better Continents.
0.3.0
A runic barrier for territories that keep monsters out. A territory with No monster spawns can now hold monsters out as well as stop them spawning. A hostile creature that reaches the edge is held outside it, and a blue shield of glowing runes flares across the edge where it pushes, then fades.
- Runic barrier, a new rule under No monster spawns on the panel's Rules tab. Tamed creatures and peaceful animals pass; bosses are held like any monster. A monster already inside (one that spawned before the barrier was switched on, or was carried in) is set down just outside the edge. 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. It is on by default for a territory you mark from now on; territories you already have are left exactly as they are, so turn it on in each one you want it in.
- Keep non-members out too, under the barrier and off by default. Players who are not members are held at the edge as well, with the same flare. One who is already inside, or arrives by portal, is set down outside with "The runes of … turn you back". Riding, sailing and sitting are left alone. Members and the owner always pass, and so do admins while
AdminsBypassProtectionis on. - Each of the two is greyed, not hidden, while the rule above it is off, and the server clears a barrier setting whose rule is off, so a hand-edited file cannot leave one switched on by itself.
[2 - Client] BarrierEffects(true): the flare and its sound. Off, the barrier still holds monsters out; only the show goes.- The Here card and
terr_listname the barrier beside No monster spawns. - The territory file is now version 3: two new rule names,
"RunicBarrier"and"BarrierKeepsOutVisitors", in the usual"flags"list. A 0.2.x or 0.1.x file loads unchanged and gains no barrier. A server rolled back to 0.2.x will not save over a version 3 file, because it would drop the barrier names, so the territories are enforced as loaded and the file is left alone until 0.3.0 runs again. - The server and every player need 0.3.0. The barrier is enforced in each player's own game, so a 0.2.x game would let monsters walk straight through it, and would not know the new rule names.
- Verified: builds against Valheim 1.0.16 with 0 warnings; every game reference and Harmony target resolves on both the client and the dedicated server; 2,893 off-game checks. An automated run with a headless dedicated server and a headless player passes 134 checks on a plain and on a Better Continents world: a Greyling hunting a player by its own AI is held at the edge and never gets in, one set inside is out in a moment, the barrier flares, tamed and peaceful animals pass, a non-member is held and turned back until made a member, and the barrier survives saving and a restart. Boots clean on a 1.0.16 dedicated server, with and without Better Continents.
0.2.0
Combined territories: any shape you can build from circles, squares and rectangles.
- Combine two territories into one. Its ground becomes both grounds together, so a territory can be an L-shaped keep, a road with a market at its end, or a ring of towers. 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.
- Territory combine, a new hammer tool: place it inside the territory to keep, then within 15 seconds inside the one to join into it. Placing in the first one again cancels. Without the hammer, use Place → Ground → Combine → Join into this in the panel (click twice), or
terr_combine <into id> <from id>. - Ground section in the panel (Place, while editing a territory). It lists the territory's parts. Move a part with the hammer, split one off into a territory of its own, remove one, or add ground with the hammer or as a circle around you.
- One territory everywhere. Protections, PvP, Sanctuary and the banner treat all parts as one area: walking from one part into another is not leaving. The map draws one outline around the whole shape, with no seams where parts overlap. The ground border runs only along the outside edge. Where territories overlap, size is the area really covered, overlaps counted once.
[1 - Server] MaxParts(16): the most parts one territory may have. Set it to 1 to turn combining off.
An epic entry banner. Entering a territory now announces its name the way the game announces a new biome: the big title between the braids, the admin's entry text beneath it, and the discovery sound the first time you enter each territory in a session. Leaving still shows "Leaving …" in the centre.
- No more banner spam at an edge. You count as inside until you are 3 m past the edge, and re-entering within 90 seconds is silent (
BannerCooldownSeconds). Dying inside is not leaving. [2 - Client] EntryBannerStyle: Epic, or Simple for 0.1.1's centre message.[2 - Client] EntrySound: FirstEntry, EveryEntry or Off.
The territory's name on the minimap. While you stand in a territory that shows on the map, its name, in its colour, replaces the biome name above the minimap. The biome name comes back when you leave. [2 - Client] MinimapTerritoryName turns this off. The large map is unchanged.
- Ground borders now draw exactly the stretch of border within
BorderRange. A small territory shows its whole ring and a narrow one both sides; from further out, a big territory shows a shorter stretch that grows as you walk up. terr_reloadof a file with a typo no longer drops every territory until it is fixed: the ones already loaded stay in force. A territory file written by a newer version of the mod is enforced but never saved over.- Infinity Hammer: a hand-kept
infinity_tools_terroritysmellatory.yamlthat lacks one of the tools no longer makes the hammer run the tool's name as a command. - The server and every player need 0.2.0. A 0.1.x game would protect only a combined territory's first part. Territory files from 0.1.x load unchanged.
- Verified: builds against Valheim 1.0.16 with 0 warnings; every game reference and all 42 Harmony targets resolve on both the client and the dedicated server; 1,304 off-game checks (shapes and combined ground, the wire and file formats, the banner's decisions, the map outline mesh). An automated run with a headless dedicated server and a headless player passes 114 checks on a plain and on a Better Continents world: combining, protection across parts, the epic banner, the minimap name, saving and reloading. Boots clean on a 1.0.16 dedicated server, with and without Better Continents, loading a 0.1.x territory file.
0.1.1
Fixes from the first playtest.
- Banners and forced PvP show together. When a territory switches your PvP on or off, the entry or exit banner carries the game's PvP notice on its second line. Before, the notice replaced the banner.
- "Buildings cannot be damaged" now means no damage at all, from anyone: creatures, fire and every player, members and admins included. Before, members' and admins' hits still landed, so an owner testing their own walls saw them take damage. Take pieces down with the hammer instead. Weather and support still apply.
- Territories show on the minimap as well as the large map, clipped to its square. Outlines now have a rim of constant width, so a large territory no longer gets a thick band at its edge. A name shows while the territory's centre is in view.
- Panel layout: every hint sits left-aligned under the option it explains. Every row of buttons, labels and fields is one height, and switched-on buttons no longer grow. Labels and steppers share one column. "Buildings cannot be damaged" moved to the World section.
- The log says at start-up whether Better Continents is loaded, and which version.
- The server and every player need 0.1.1: the building rule runs on whichever player's game owns the building.
0.1.0
First release.
- Territories as circles, squares or rotated rectangles. Admins mark them with Infinity Hammer (the Territory tool) or around themselves (
terr_here). The server saves them per world and sends them to every player. - Rules per territory: members-only building, doors/chests/stations and harvesting; buildings that cannot be damaged; no monster spawns; no raids; no skill loss on death; forced PvP off (safe zone) or on (war zone); a Sanctuary status effect with regen, carry and armour bonuses; entry and exit banners; map outline and name; ground border.
- Owner and members, chosen from the players online or by player id. Admins bypass protections (configurable).
- Overlaps: the smaller territory rules its own ground; priority overrides that.
- Panel (Home): where you are and what applies to you, a list of every territory, and for admins the rules, members and placement.
- Fixing mistakes with the hammer: Territory remove (place twice to confirm) and Territory edit (opens the panel on that territory, including move/reshape).
- The territory file is readable JSON with rule names, via Newtonsoft (depends on
ValheimModding-JsonDotNET). A file that fails to read is never overwritten, and the error names where it broke. - Verified: builds against Valheim 1.0.16; every game reference and all 40 Harmony targets resolve on both the client and the dedicated server; boots clean on a 1.0.16 dedicated server; 557 off-game checks on shapes, overlaps, the wire format, the file format and Infinity Hammer's command substitution.