KodeMansMods-CraftFromContainersEvolved icon

CraftFromContainersEvolved

WIP: Craft, build and upgrade from nearby containers with owner-strict, ward-aware access rules and server-enforced policy.

Last updated 15 hours ago
Total downloads 1234
Total rating 1 
Categories Mods Tools Server-side Utility AI Generated Deep North Update
Dependency string KodeMansMods-CraftFromContainersEvolved-1.0.3
Dependants 0 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2351 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2351

README

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.
  • 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.

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.

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