Valheim
Install with App

Details

Latest version
1.1.2
Last Updated
First Uploaded
Downloads
5.4K
Likes
1
Size
45KB
Dependants
ADDatHost Valheim hosting
30% off

Craft From Containers Evolved

by KodeMan

Work in progress: this release has not been fully play-tested yet. Expect rough edges and please report anything you find on Discord.

Craft, build and upgrade using the resources in nearby containers - without letting other players turn your storage into their personal warehouse.

This is an independent reimplementation of the classic "craft from containers" idea for Valheim 1.0 with a security model designed for shared worlds: your chests only work for the people you actually share them with, and servers can enforce the rules.

What it does

  • Use resources from nearby containers when crafting, upgrading and building.
  • Add ore or wood, fuel, food and ammo to stations from nearby containers: smelters, kilns, blast furnaces, cooking stations, fires, torches and ballista turrets. Stations use everything they normally accept - a kiln burns corewood and finewood too.
  • The crafting UI shows the combined amount available in your inventory plus allowed containers, for example 87/40.
  • Counters turn amber when a resource is only available in containers, red when it is missing entirely, and white when your inventory alone is enough.
  • Containers in range are used automatically - no extra slots, tabs or menus.
  • Pull order defaults to the closest container first, and an optional "leave one" rule keeps a single item in every stack (recipes that would need the last item of a stack are treated as not craftable).
  • Container type filters for ships, carts, wood chests, reinforced chests, black metal chests, personal chests and tombstones.
  • Compatible with personal chests and wards: if a container passes the game's own access checks, it can be used according to the active security mode.

No more crafting-table griefing

In shared worlds, a player can build a crafting station next to (or even against the outside wall of) your storage and, with older container-pulling mods, silently craft with your materials. Craft From Containers Evolved stops that by default:

  • Every container must pass the same access rules the game uses when a player opens it. Containers that are in use by someone else, private chests you do not own, and ward-protected containers you have no permission in are never touched.
  • OwnerStrict (default): a container is only used if the piece was created by you. Ownership is the creator id the game stores on every player-placed object, so it survives restarts and does not require a ward. A stranger's workbench next to your chests simply finds nothing, because your chests are not theirs.
  • Wards remain the sharing mechanism: with IncludeWardPermitted enabled, containers inside an enabled ward you have permission in are also used, so teammates can share storage the same way the base game lets them share doors and chests.

Security modes

Mode Behaviour
OwnerStrict (default) Only containers created by you, optionally plus containers inside a ward you have permission in.
WardStrict The game's own access checks plus: never use containers inside an enabled ward you are not permitted in, even if the container is public.
Vanilla Only mirror the game's own checks: anything you could open manually can be used for crafting.

Server-enforced policy

Install the mod on the server as well and the server becomes the authority:

  • The server broadcasts its security settings when players spawn and whenever the settings change.
  • Clients can only ever be stricter than the server, never looser. If the server uses OwnerStrict, a client set to Vanilla still gets OwnerStrict behaviour.
  • The pull range is capped by the server value, and container-type ignores are combined so a server can force additional exclusions.
  • Server-side write protection: the server validates every container write and container request. Forged messages from modified clients are dropped before they touch a chest, claimed player ids are verified against the real sender, denials are audit-logged, and modded clients are told when a request is denied. World containers (dungeon chests) keep vanilla behaviour.

With Server/EnforceModeOnWrites = true (default) the AccessMode also applies to writes: under OwnerStrict only the creator and ward-permitted players can modify a container. Because the server cannot tell a scripted pull from a manual loot, this also means players without ward permission cannot manually loot a teammate's public chest - share through wards, or set the option to false for pure vanilla looting with privacy and ward enforcement only.

Existing worlds and shared bases

In OwnerStrict (default) a container is usable only by the player who created it. On worlds that changed hands, moved between servers or accounts, or contain chests placed by former members, those chests are blocked even though they may look public. The server log shows the reason for each block, for example Denied container open ...: NotOwner (WardDenied and OpenAccessDenied are the other reasons), and modded clients get a message when an action is refused.

Server owners have three ways to handle this:

  • Security/AccessMode = WardStrict - chests outside any ward become open to everyone; only warded chests are restricted.
  • Security/AccessMode = Vanilla - only the game's own checks apply (privacy and wards).
  • Server/EnforceModeOnWrites = false - manual chest interaction stays exactly vanilla, while the player-set AccessMode still applies to crafting pulls made by modded clients.

Players without the mod are refused silently; only modded clients see the "no access" message.

Compatibility with container mods

The security modes and the server write gate apply to vanilla storage (chests, ships, carts, world chests and similar). Container types added by other mods are detected automatically: when a mod's container is a subclass of the game's Container with its own synchronisation - like RossItemDrawers' Item Drawers - it is left entirely to that mod's own access and sync model. Drawers and similar storage keep working between players under any AccessMode, and the write gate never interferes with their custom state.

To cover a modded container with the security modes anyway, add its prefab name prefix to Compatibility/ExtraProtectedContainerPrefabs. To force a container to be ignored by the security modes, use Compatibility/AlwaysUnmanagedContainerPrefabs.

Versions 1.1.1 and older treated modded containers as vanilla chests. If you used them together with OwnerStrict write enforcement and Item Drawers, drawers could lose contents when depositing or switching modes. Update to 1.1.2, and empty or replace affected drawers before changing modes. Items lost that way cannot be recovered by the mod - use an admin spawn or a save rollback.

Crafting UI

  • Requirement rows display available/required including allowed containers.
  • Amber means the missing amount comes from containers, red means it is missing everywhere.
  • ResourceCostString, ContainerAvailableColor and InsufficientColor let you change the format and colours.

Configuration

Config file: BepInEx/config/CraftFromContainersEvolved.cfg.

Setting Default Description
General/Enabled true Enable the mod.
General/Debug false Log why containers are skipped and where resources come from.
General/ContainerRange 10 Maximum pull distance in metres. 0 means unlimited.
General/ApplyToCrafting true Use containers when crafting and upgrading.
General/ApplyToBuilding true Use containers when building.
General/PullByDistance true Pull from the closest containers first.
General/LeaveOne false Keep at least one item in every container stack; recipes needing the last item are treated as not craftable.
Security/AccessMode OwnerStrict Vanilla, WardStrict or OwnerStrict.
Security/IncludeWardPermitted true In OwnerStrict, also allow ward-permitted containers.
Container Types/IgnoreShipContainers false Ignore containers on ships.
Container Types/IgnoreWagonContainers false Ignore containers on carts.
Container Types/IgnoreWoodChests false Ignore wood chests.
Container Types/IgnoreReinforcedChests false Ignore reinforced chests.
Container Types/IgnoreBlackMetalChests false Ignore black metal chests.
Container Types/IgnorePrivateChests false Ignore personal chests.
Container Types/IgnoreTombstones true Ignore tombstones.
UI/ShowContainerCounts true Show combined inventory plus container counts.
UI/ResourceCostString {0}/{1} Format of the resource counter.
UI/ContainerAvailableColor FFEB04 Colour when a resource is only available in containers.
UI/InsufficientColor FF4040 Colour when a resource is missing.
Server/EnforceServerPolicy true Apply the connected server's security policy.
Server/ServerEnforcement true Validate container writes and requests on the server.
Server/EnforceModeOnWrites true Apply the access mode to writes; false for pure vanilla access parity.
Server/LogDeniedAttempts true Rate-limited denial logging.
Server/NotifyDeniedPlayers true Message modded clients when the server denies access to a container.
Stations/PullOre true Use containers to add ore or wood to smelters, kilns and blast furnaces.
Stations/PullFuel true Use containers to add fuel to smelters, cooking stations, fires and torches.
Stations/PullCooking true Use containers to add food to cooking stations.
Stations/PullAmmo true Use containers to reload ballista turrets.
Stations/IgnoreTypes (empty) Comma-separated item names never pulled for stations.
Compatibility/ExtraProtectedContainerPrefabs (empty) Prefab name prefixes to protect with the security modes even though they are modded containers.
Compatibility/AlwaysUnmanagedContainerPrefabs (empty) Prefab name prefixes the security modes never touch.

Installation

  1. Install BepInEx 5.4.23 or newer for Valheim.
  2. Place CraftFromContainersEvolved.dll and CraftFromContainersEvolved.Core.dll in BepInEx/plugins/ (a subfolder such as BepInEx/plugins/CraftFromContainersEvolved/ also works).
  3. With r2modman or the Thunderstore Mod Manager, use Settings > Import mod from file and select the release zip, or install the package from this page.

Do not run this alongside any other craft-from-containers mod (including the original Craft From Containers and its forks): they patch the same player methods and the results will be unpredictable.

Multiplayer notes

  • Install the mod on the server to get server-side enforcement. Clients alone can always be bypassed by modified clients; the server gate is what stops them.
  • Players who do not install the mod are still subject to the server gate; they simply do not get the container-crafting feature. Only the server needs the mod for protection.
  • Access checks on clients are still useful for the UI and for single-player, and the server validates everything it can see.
  • When the server denies access, modded clients show a short message. Players without the mod are refused silently.

Known limitations

  • Contents of nearby containers remain visible to clients as in vanilla; enforcement stops unauthorized writes, not read-only sync.
  • This secures storage access. It is not a general anti-cheat: spawning or duplicating items through other vanilla trust holes is out of scope.
  • Internals are Valheim 1.0.16-specific. The plugin verifies its patch targets at startup and logs an error if a game update breaks the enforcement layer.

Compatibility

  • Built for Valheim 1.0.16 (Deep North) with BepInEx 5.4.23.5.
  • Does not replace methods, so it coexists more gracefully with other crafting mods than a full method replacement would.
  • Conflicts with other craft-from-containers mods; run only one of them.

Feedback and issues

Server owners and players: report problems, false denials or feature requests in the comments of this mod page or on Discord. Include your Valheim and BepInEx versions, whether you run the mod on the client, the server or both, and the relevant LogOutput.log lines when possible.

Credits

Inspired by the feature set of aedenthorn's Craft From Containers. This is an independent implementation with a different security model and no shared code.

Licensed under the MIT license.

Support

Questions, bug reports and testing feedback: https://discord.gg/W8vMj3PfVT

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