Published today, 6/10/26 9:00 am
scheduled
- 26 views • 17 today
- 2
- 0
58
Protecting Valheim Portals From Renaming
The Portal Baking System is a simple Expand World Prefabs script that lets server admins protect selected portals from being renamed.
Once a portal has been “baked,” the script remembers its current portal tag. If a player changes the portal name later, the portal automatically changes itself back to the protected name and reconnects to its proper destination.
This is useful for public servers, persistent worlds, community hubs, dungeon entrances, event areas, or any situation where you do not want important portals to be renamed.
What the System Does
Normally, Valheim portals connect based on their tag. If someone changes the tag, the portal disconnects from its intended partner and may connect somewhere else.
This script prevents that problem by saving the portal’s current tag as its protected name.
When the portal tag changes, the script checks whether the portal is protected. If it is protected, and the new tag does not match the saved protected name, the script restores the original tag.
In simple terms:
You name the portals.
You run the bake command.
The portal remembers that name.
If the name changes later, it changes back automatically.
Supported Portal Types
The script is designed to work with these portal prefabs:
portal_stone
portal_wood
portal
That means it can protect standard portals as well as the stone and wood portal variants, depending on what exists on your server.
Basic Usage
There are two main commands.
Protect the Closest Portal
Stand near the portal you want to protect and say:
/say bakeportal
The script will look for the closest portal within range. When it finds one, it saves the portal’s current tag as the protected name.
If there is another portal with the same tag, the script can also apply the same protection to the matching portal, allowing both sides of the portal pair to be secured.
Use this command when you only want to protect one specific portal pair.
Protect All Portals
To protect many portals at once, say:
/say bakeallportals
This command searches for portals over a much larger area and attempts to bake all matching portals it finds.
This is useful if you already have a finished portal network and want to secure the whole system at once.
For safety, it is usually best to test
/say bakeportal first on one portal pair before using /say bakeallportals across a larger world.Recommended Workflow
Before baking a portal, make sure the portal is already named correctly.
For example, if you have two portals that should connect to each other, both portals should already have the same tag:
MAINBASE
Then stand near one of them and run:
/say bakeportal
After the portal is baked, try changing the name manually. If the script is working, the portal should automatically return to its protected name.
What “Baking” Means
In this system, “baking” a portal means storing its current tag as protected data.
The script adds data to the portal that marks it as protected:
isProtectedPortal, 1
It also stores the protected portal name:
protectedName, <string_tag>
After this data is applied, the script knows that the portal should not be allowed to keep a different tag.
How the Protection Works
The script listens for changes to the portal’s tag.
When a protected portal is renamed, the script compares the new tag against the saved protected name.
If the new tag is different, the script sends the portal a tag update and restores the original protected name.
After that, the portal is refreshed so it reconnects properly.
This means the protection is automatic. Players can still try to rename the portal, but the portal will correct itself.
Important Notes
Make sure the portal names are correct before baking them.
Once a portal is protected, the script is designed to restore that saved name. If you want to intentionally change a protected portal later, you should adjust your script setup or protection data first, then bake the portal again with the new name.
It is also a good idea to back up important worlds before applying large world-wide changes, especially before using commands that affect many portals at once.
In Summary
The Portal Baking System gives server admins a simple way to protect important portals.
Use:
/say bakeportal
to protect the closest portal.
Use:
/say bakeallportals
to protect many portals at once.
After a portal is baked, it remembers its correct name. If someone changes it, the portal automatically restores itself and reconnects.
This makes portal networks more reliable, especially on public or persistent Valheim servers where players may accidentally or intentionally rename important portals.
| Tags |
3810
6


Have something to say?