CartographyTableMapRestrict
Hides the minimap and the map keybind. The world map can only be opened by using a cartography table. Rebuilt for Valheim 1.0.x.
About this mod Author’s original text
Cartography Table Map Restrict — updated for Valheim 1.0.x
Hides the minimap and the map keybind. The world map can only be opened by using
a cartography table. Rebuilt from
aedenthorn/ValheimMods
against Valheim 1.0.15 and BepInEx 5.4.23.
Why the original stopped working
Two things in the original broke on current Valheim:
- Minimap.instance became a property. It used to be a public static field. A DLL compiled
against the old game still looks for a field, so the plugin threw MissingFieldException
the moment a cartography table was used.
- The map toggle was rewritten. Minimap.Update now re-opens the small map on its own
(if (m_mode == MapMode.None) SetMapMode(MapMode.Small);) and gates the toggle behind
m_shownFrames / m_hiddenFrames counters that did not exist before. The original mod fought
this every frame by forcing MapMode.None and calling SetActive(false) in an Update postfix.
What changed in this version
The mod no longer patches Minimap.Update at all. m_smallRoot is touched by exactly two methods
in the game (Minimap.Awake and Minimap.SetMapMode), so a single SetMapMode patch covers
everything, with no per-frame work:
| Patch | Purpose |
|---|---|
| Minimap.SetMapMode prefix | Rewrites any switch to MapMode.Large into MapMode.Small, unless the cartography table asked for it. This is what blocks the map keybind. |
| Minimap.SetMapMode postfix | Keeps m_smallRoot deactivated, hiding the minimap. |
| MapTable.OnRead(Switch, Humanoid, ItemData) postfix | Opens the large map. This is the 3-argument overload wired to the table's read switch — the original patched the 4-argument one, which OnWrite also calls, so saving to the table opened the map too. |
| MapTable.OnRead(..., bool showMessage) prefix | Suppresses the "map synced" message. |
| Minimap.ShowPointOnMap prefix | Stops Minimap.DiscoverLocation from throwing the map open when you find a boss stone. |
Closing still works normally: with the large map open, the map key and Escape both route through
SetMapMode(MapMode.Small), which the prefix leaves alone.
Dedicated server / multiplayer
The mod is client-side only. It is marked [BepInProcess("valheim.exe")], so it will not load
into valheim_server.exe even if the DLL ends up in the server's plugin folder.
- It patches nothing but local UI. It registers no RPCs and touches no ZDO, so it does not
change the network protocol and will not cause a version mismatch or a kick.
- It does not need to be installed on the dedicated server.
- Every player who should have the restriction must install it themselves — a client-side mod
cannot enforce this on anyone else. See BypassServerNoMap below for the enforceable route.
- Map exploration is still recorded while the minimap is hidden (Minimap.UpdateExplore runs
regardless of map mode), and sharing map data through the table is untouched.
Enforcing it for everyone
Valheim's own No Map world modifier is server-enforced, but on its own it also kills the
cartography table: Minimap.SetMapMode clamps every mode to None while Game.m_noMap is set.
With BypassServerNoMap = true (the default) this mod lifts that clamp for the duration of the
table's call, so you can run the server with the nomap modifier and still read the table:
- players without the mod get vanilla no-map — enforced by the server;
- players with the mod additionally get a working cartography table.
Game.UpdateNoMap only runs on spawn and when world modifiers change, so nothing re-closes the map
behind you.
If you are not using the server modifier, leave the modifier off and just have everyone install
the mod — that is the simpler setup.
Config
BepInEx/config/aedenthorn.CartographyTableMapRestrict.cfg
| Key | Default | Meaning |
|---|---|---|
| Enabled | true | Master switch. Can be toggled at runtime. |
| HideMinimap | true | Hide the corner minimap. |
| SuppressMessage | true | Hide the "map synced" message when reading the table. |
| PreventAutoOpen | true | Stop the map force-opening on locat
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.