Valheim
Install with App

Details

Latest version
1.0.0
Last Updated
First Uploaded
Downloads
700
Likes
0
Size
11KB
Dependants
ADDatHost Valheim hosting
30% off

McPortalMetal

Carry ore and bars through portals.

Client-side. It works on a server that does not have the mod, and it changes nothing for anyone else playing there.

Why it works without the server

The portal decides on your own machine. TeleportWorld.Teleport asks Humanoid.IsTeleportable, which walks your inventory looking for an item flagged as non-teleportable. If nothing objects, that same client calls player.TeleportTo itself.

The server never re-validates the inventory. It only sees your character move, and you already own your own character, so the move is accepted like any other step you take. No RPC asks permission, and there is no server-side check to fail.

That also means the effect is strictly yours: no other player's inventory is consulted, and nothing about the world or the server is written.

How it does it

The restriction is cleared on the item definitions, not by intercepting the portal's question.

That matters because the portal is not the only thing reading the flag. The inventory grid draws its red no-teleport badge straight from m_shared.m_teleportable, and the item tooltip appends its warning from the same field. A mod that only answers the portal leaves the interface insisting your ore cannot travel while it quietly does — which reads as a broken mod, and gets people to drop their ore before stepping through. Clearing the flag at the source keeps the badge, the tooltip and the portal all telling the same story.

What is left alone

  • allowAllItems portals and the TeleportAll global key keep working exactly as the game intends. This mod never overrides them.
  • Items the game never allows through (tool tier 1000 and above are refused even with TeleportAll set) are skipped. That is the game saying "never" rather than "not by default".
  • Turning the mod off puts every flag back, immediately, without a restart. Uninstalling leaves no trace.

Configuration

BepInEx/config/joaorodrigues.valheim.mcportalmetal.cfg, written on first launch.

Setting Default What it does
Enabled true Off restores the stock restriction straight away.
BlockedItems (empty) Items to keep restricted, comma-separated prefab names. Empty means everything may pass.

BlockedItems uses prefab names as the console uses them, matched case-insensitively. To keep the late-game grind intact while freeing the rest:

BlockedItems = FlametalOre, BlackMetalScrap

Both settings apply the moment you change them.

Installation

Install with a mod manager, or drop McPortalMetal.dll into BepInEx/plugins. Requires BepInEx for Valheim.

Install it on your own game, not on a dedicated server. The plugin is scoped to the game client and will not load on valheim_server.exe at all — no log line, no config file. If you are hosting from your own game rather than a dedicated server, that is the client, so it loads and applies to your character as normal.

A note on shared servers

Ore through portals is a balance rule most servers keep on purpose. This is client-side, so it affects only you and breaks nothing for anyone else — but on someone else's server it is still the kind of thing worth asking the admin about first. If you want it for everyone, the game already has a supported way: an admin can set the TeleportAll global key, which this mod deliberately leaves working.

Source

https://github.com/jcastro09/McPortalMetal

MIT licensed. Built from the game's own decompiled code.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.