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.
PauseMyServer
Pause a server-hosted game: the world pauses when every player online has asked for a pause (the ESC menu, or a mod that pauses for an open map or panel), and an admin can pause the whole server for everyone with a key.
| Date uploaded | 4 days ago |
| Version | 1.5.0 |
| Download link | DeathMonger-PauseMyServer-1.5.0.zip |
| Downloads | 219 |
| Dependency string | DeathMonger-PauseMyServer-1.5.0 |
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.2350README
Pause My Server
Pause a server-hosted Valheim game.
Vanilla only pauses when you host the world yourself and nobody else is connected. On a dedicated server the menu never pauses anything: the day rolls on, raids fire, your smelter finishes and the boar you were fighting keeps chewing. This mod gives you two ways to pause a server.
Everyone asking for a pause pauses the game
When every player online has asked for a pause, the world pauses, exactly like solo. Opening the ESC menu is how you ask; a mod can ask for you (see below):
- Every client freezes (monsters, ships, physics, crafting, everything you see).
- The server freezes its world clock, so day and night, weather, plant growth, fermenters, beehives and respawn timers stop too.
- Raids and other random events are held.
- A sleep time-skip in progress waits.
Alone on the server, that is just you: open the menu and the world stops. With friends, the game pauses the moment the last of you asks. Anyone closing their menu resumes it instantly, and so does a new player arriving (you will see a small message if your menu is still open).
While you have asked for a pause but the game keeps running because others are still playing, the label reads "Unpaused" in bright red, with "1/3 want to pause" underneath, so a pause you asked for and did not get is never silent.
Vanilla behavior is kept for hosted (non-dedicated) games, where the host already pauses when alone; with guests online the host's request counts like everyone else's.
Other mods can ask for a pause
Any mod that calls Valheim's own Game.Pause() and Game.Unpause() takes part, with no reference to this mod and no API to call. The request goes to the server like a menu request, counts towards "everyone has asked", and the red warning appears if it is refused. Two of ours do it: The Greatest Map pauses while the large map is open, and Grab Materials while the inventory panel is open.
For a mod that wants to show its own state, Game.IsPaused() is the honest answer: it is true only when the game really is frozen, whether this mod is installed or not. There is nothing else to query.
One caveat, and it is vanilla's: the game keeps a single pause flag, not a count. If two mods ask at once and one of them calls Game.Unpause(), the request is dropped for both. A mod that pauses for a panel should re-assert while its panel is open.
Admin pause
An admin (listed in the server's adminlist) presses the pause key, by default the keyboard's Pause key, to pause the whole server for everyone, whatever their menus:
- Every client freezes, whether or not their menu is open.
- Players who join during the pause are frozen as soon as they spawn.
- The pause stays until any admin presses the key again. A non-admin who presses it gets a notice.
- The label reads "Paused by <admin>", and everyone gets a "Game resumed by <admin>" message afterwards.
- Safety net: when the last player leaves, an admin pause is dropped, so the next player to log in is not frozen with nobody online to resume.
Console commands (F5): pms_pause toggles the admin pause like the key, and pms_status prints the state. On the dedicated server's own console pms_pause toggles directly, which is the way out if no admin is online.
The admin pause is designed for dedicated servers. On a hosted (non-dedicated) game the host freezes with everyone else, and a player joining during the pause may have to wait until it is lifted.
The on-screen label
A persistent label is shown while the game is paused, in solo games too: "Paused", or "Paused by <admin>". When a pause has been asked for and the game is still running, it turns bright red and reads "Unpaused", with "1/3 want to pause" on a second line in a smaller font. It waits half a second first, so the trip to the server and back never flashes red, and it stays quiet during the intro and cinematics. Texts, position (top or bottom) and size are configurable, and each mode can be turned off.
Telling a monitor or dashboard
The server keeps a small JSON file up to date so anything outside the game can see the pause state without scraping the log:
BepInEx/config/PauseMyServer.state.json
{"paused":true,"by":"Genius","wanting":1,"players":2,
"since":"2026-09-23T17:45:12.482Z","written":"2026-09-23T17:46:02.114Z",
"heartbeat":5,"version":"1.5.0"}
| Field | Meaning |
|---|---|
paused |
Whether the world is frozen right now. |
by |
Who holds it: an admin's name, a player's name, or everyone. Empty when not paused. |
wanting |
How many players have asked for a pause. |
players |
How many are online. |
since |
When paused last flipped, UTC. |
written |
When this file was last written, UTC. |
heartbeat |
Seconds between rewrites while nothing changes. |
version |
The mod version that wrote it. |
Read it by age, not just by content. The file is rewritten on every change and again every few seconds regardless, so written tells you the mod is alive. That is the whole trust model: fresh means live, stale means ignore it. Allow three missed heartbeats before calling it dead, and treat a missing file as "not running", which is also what you get deliberately when the world shuts down.
Writes are atomic, to a temporary file that is then swapped in, so a reader can never catch a half-written file. Only servers write it, clients never do, and Publish State File under Server turns it off.
Installation
Install on the server and on every client (Gale, r2modman or Thunderstore Mod Manager, or drop PauseMyServer.dll into BepInEx/plugins). Keep the same version everywhere.
- Server without the mod: clients simply never pause, same as vanilla. Nothing breaks.
- Client without the mod: that player cannot ask for a pause, so the game never pauses while they are online unless an admin pauses; they are not frozen by an admin pause either.
Works on Windows and Linux dedicated servers. Requires BepInExPack for Valheim.
Configuration
BepInEx/config/DeathMonger.PauseMyServer.cfg (client side):
| Section | Setting | Default | Meaning |
|---|---|---|---|
| General | Mod Enabled | true | Master toggle; disables every patch without removing the DLL. Restart required. |
| General | Show Messages | true | Top-left HUD message when the game resumes for a reason other than you closing your menu. |
| Admin | Pause Key | Pause | Admins only: toggle the server-wide pause. Ignored while typing in chat, the console or a text box. |
| Server | Publish State File | true | Keep PauseMyServer.state.json up to date for a monitor or dashboard. Servers only. |
| Pause Message | Show Pause Message | true | Show the persistent on-screen label while paused. |
| Pause Message | Text | Paused | The label text. |
| Pause Message | Admin Text | Paused by {0} | The label text during an admin pause; {0} is the admin's name. |
| Pause Message | Position | Bottom | Centered at the Top or the Bottom of the screen. |
| Pause Message | Font Size | 40 | Label size at a 1920x1080 reference; scales with the screen. |
| Pause Message | Show Unpaused Warning | true | Red label while a pause has been asked for and the game is still running. |
| Pause Message | Unpaused Text | Unpaused | The warning's first line. |
| Pause Message | Unpaused Count Text | {0}/{1} want to pause | The warning's second line, smaller: {0} have asked for a pause, {1} are online. Empty for no second line. |
Label settings apply the next time the label appears, no restart needed. The server needs no configuration.
How it works
The server is the single authority. Clients only ever send wishes: "my menu is open", "my menu is closed", "toggle the admin pause". Every frame the server works out whether the world should be paused, either because every player online wants it or because an admin set the pause, and broadcasts the state to everybody when it changes, along with how many players want the pause. A client freezes only after the server confirms, so a server without the mod cannot leave a client frozen while the world runs on without it. A player who spawns asks for the current state, which is how a joiner during an admin pause is frozen too.
Client side, a handful of small Harmony patches: postfixes on Game.Pause and Game.Unpause track the menu, a postfix on Game.IsPaused reports "paused" once the server has confirmed and either the menu is still open or the pause is an admin pause, and a postfix on Player.OnSpawned requests the state. Vanilla's own Game.UpdatePause then sets the time scale to zero, the same code path solo uses. Closing the menu resumes locally at once, without waiting for the round trip.
Server side, three prefixes hold the parts of the world the server itself runs while its clients are frozen: ZNet.UpdateNetTime (the world clock), RandEventSystem.FixedUpdate (raids) and EnvMan.UpdateTimeSkip (sleeping). The server's own frame time is deliberately left running: at time scale zero the server would stop sending player lists and world data, and a joining player could never load in. Everything near a player is owned and simulated by that player's client, so freezing the clients freezes the rest.
While frozen, a client still answers the server's keep-alive pings (Valheim's receive loop does not depend on frame time), so nobody gets disconnected.
The label is drawn on the mod's own overlay canvas, above the menu, using the font of the game's own HUD messages. It shows whenever the game reports itself paused, which includes a solo host pausing.
Compatibility
- Does not touch
Game.CanPause, so mods that let you pause in debug mode still work. - Mods that change
Time.timeScalethemselves (speed-up or slow-motion mods) may fight with the freeze. - Autosave keeps running on the server while paused; that is harmless.
- 1.1.0 and 1.2.0 work together either way round; older clients just do not see the counts in the red label.
Source
CHANGELOG
Changelog
1.5.0 — 2026-09-25
- The server publishes its pause state to a file, so a monitor or dashboard can read it instead of scraping the log:
BepInEx/config/PauseMyServer.state.json, holding whether the world is paused, who holds it, how many players want a pause, how many are online, and when the state last changed. - Written on every change and rewritten every few seconds as a heartbeat, so a reader can tell "running and not paused" from "the mod is not running". The file's age is the whole trust model. It is removed when the world shuts down.
- Turn it off with Publish State File under Server. Clients never write it.
1.4.1 — 2026-09-15
- The label no longer writes a TextMeshPro warning about a missing LiberationSans font asset into the log every time it is built. It now takes the HUD's font before the component starts up rather than just after.
- American spelling in the config descriptions and the README.
1.4.0 — 2026-09-14
- Shorter labels. "Game paused" becomes "Paused", and "Game Unpaused (1 of 2 players paused)" becomes "Unpaused" with "1/2 want to pause" on a second line in a smaller font.
- Existing config files are updated in place, so the new wording appears without editing anything. A text you chose yourself is left alone.
- Clear the second line's setting to have no second line at all.
1.3.0 — 2026-09-13
- Any mod can ask for a pause. A mod that calls
Game.Pause()for its own reason, an open map or an open inventory panel, now counts as that player asking for a pause, exactly like the ESC menu. Nothing to add on their side. - The red "Game Unpaused" warning follows the request instead of the ESC menu, so a pause that was asked for and refused is always visible. Before, a mod could ask for a pause, not get one, and say nothing.
- The warning waits half a second before appearing, so the trip to the server and back never flashes red, and it stays quiet during the intro and cinematics.
1.2.0 — 2026-09-13
- Everyone in the menu pauses the game. The lone-player rule is now the general one: the world pauses when every player online has the ESC menu open. Anyone closing their menu, or a new player arriving, resumes it. Alone, nothing changes.
- The red "Game Unpaused" label shows how many are in: "Game Unpaused (1 of 3 players paused)" (text configurable). Against a 1.1.0 server it falls back to the plain text.
- Compatible both ways with 1.1.0: older clients still pause when everyone is in the menu, they just do not see the counts.
- With the large map open (possible during an admin pause) the label moves into the strip between the map's edge and the screen edge instead of sitting on the map.
1.1.0 — 2026-09-12
- Admin pause. An admin presses the pause key (default: the keyboard's Pause key, configurable) to pause the whole server for everyone, even with other players online. Players who join meanwhile are frozen as soon as they spawn. It stays until any admin presses the key again. Non-admins who press it get a notice.
- The label reads "Game paused by <admin>" during an admin pause (configurable), and everyone gets a "Game resumed by <admin>" message when it is lifted.
- Safety net: when the last player leaves, an admin pause is dropped, so the next player to log in is not frozen with nobody online to resume.
- Console commands:
pms_pause(toggle, same as the key; on the dedicated server's own console it toggles directly) andpms_status. - A persistent "Game paused" label is shown on screen while the game is paused (in solo too). Text, position (top or bottom) and font size are configurable; the label can be turned off. The top-left "World paused" message is gone.
- When the ESC menu is up but the game keeps running because other players are online, the label reads "Game Unpaused" in bright red instead (configurable, can be turned off).
1.0.0 — 2026-09-11
First release. For Valheim 1.0. Install on the server and all clients.
- The ESC menu pauses the world when you are the only player online on a dedicated server: your client freezes like solo, and the server holds the world clock, raids and sleep time-skips.
- Closing the menu resumes instantly. Another player joining, or the pausing player logging out, resumes the world on its own.
- Server-authoritative: a client only freezes after the server confirms, so a server without the mod behaves like vanilla.
- Config: master toggle and a HUD message toggle (client side).