

BepInEx plugins for limiting the number of Valheim portals each player can own and for adding admin-marked discovery portals.
PortalLimitServer.dll to the dedicated server BepInEx/plugins folder.PortalLimitClient.dll to each admin/player client BepInEx/plugins folder.The server plugin is authoritative and deletes excess portals. The client plugin provides nicer placement blocking and the in-game admin UI.
Players can type /portals in chat to see their current counted portal total and the server limit.
For player modpacks, upload the Thunderstore package that contains only PortalLimitClient.dll. Dedicated servers should install PortalLimitServer.dll separately.
Run package_thunderstore.bat to build both packages:
dist/PortalLimit-0.1.0-Thunderstore.zip: player/modpack package for Thunderstore.dist/PortalLimit-0.1.0-Server.zip: server-owner package with PortalLimitServer.dll and the matching PortalLimitClient.dll for AzuAntiCheat whitelist.If your server uses AzuAntiCheat, copy the exact PortalLimitClient.dll from the player package to BepInEx/config/AzuAntiCheat_Whitelist/PortalLimitClient.dll on the server.
Use /portallimit in chat or press F10 to open the admin window. Admins can also look at a portal and press the normal interact key, E by default, to open the This Portal editor instead of Valheim's tag prompt. Only Valheim admins can edit server settings. The window has separate tabs for server-wide settings and the portal the admin is currently looking at.
Admins with the client plugin also get this window automatically after placing a portal. This can be turned off in the server settings tab with After I place a portal. The E behavior can be turned off locally in the same tab with When an admin presses E on a portal.
Admins can mark existing portals as discovery-gated pairs from the admin UI:
This Portal tab, set a portal tag such as Bog Witch, choose Locked entrance, then click Apply.Unlock entrance, then click Apply.Players must use the unlock entrance first. Once they do, that portal tag is saved for that player and they can use the locked entrance normally.
The This Portal tab automatically reads the portal the admin is looking at, so existing portal settings can be edited later by looking at the portal, changing the choice, and clicking Apply.
Clients with the plugin can also show a colored UNLOCK ON OTHER SIDE marker in the middle of locked entrances. The marker only appears while that entrance is still locked for that player. Each marked portal has a marker color dropdown in the This Portal tab with Red, Black, White, Green, and Orange options, and the server settings tab controls whether the marker is shown and whether the connected orange glow is hidden while locked.
MaxPortalsPerPlayer: maximum portals per creator. 0 disables the limit.AdminBypass: lets Valheim admins exceed the limit.EnforceOnServer: keeps server-side deletion enabled.PortalPrefabNames: comma-separated portal prefab names. Empty means all TeleportWorld pieces.Discovery Portals.Enabled: enables per-player discovery-gated portals.Discovery Portals.AdminBypass: lets admins use locked discovery portals without unlocking them.Discovery Portals.ShowHoverText: adds discovery status text to portal hover text for clients with the plugin.Discovery Portals.LockedHoverText: hover text for a locked portal before unlock.Discovery Portals.RemoteHoverText: hover text for the discovery side.Discovery Portals.UnlockedHoverText: hover text after unlock.Discovery Portals.LockedMessage: top-left message when a player tries to use a locked portal.Discovery Portals.UnlockMessage: top-left message when a player unlocks a route.Discovery Portals.ShowWorldMarker: shows a colored UNLOCK ON OTHER SIDE marker on locked entrances.Discovery Portals.TintPortalModel: legacy setting, currently ignored by the client UI.Discovery Portals.SuppressLockedGlow: hides connected portal particle/light effects while the portal is locked.Discovery Portals.LockedColor: color for locked portals before unlock.Discovery Portals.RemoteColor: color for the far-side portal that unlocks the route.Discovery Portals.UnlockedColor: color after the player has unlocked the route.Player unlocks are stored on the server in BepInEx/config/PortalLimit/discovery_unlocks.txt.