Valheim
Install with App

Details

Latest version
0.10.1
Last Updated
First Uploaded
Downloads
898
Likes
0
Size
78KB
Dependants
ADDatHost Valheim hosting
30% off

Craft From Container Groups

*this mod was made with AI. I tested everything in game myself and tweaked the design, but the code is done by Ai. This mod was made for me but I figured I'd post it so I can download easier and maybe some people will like it. Please report anything that seems off on the issues page.

Craft, build and feed smelters straight from your chests, but only from the chests you choose.

You put chests, crafting stations and smelters into groups. Things that share a group work together: a forge in the group Forge pulls from chests in Forge, and nothing else. Other people's chests and your decor chests stay untouched. groups will adopt different colors so they can be distinguished.

Made for Valheim 1.0 (BepInEx).


Features

  • Groups instead of "every chest in range". Chests are only used when they share a group with the station, smelter or workbench area you're using.
  • Several groups per object. A chest of wood can serve both Forge and Building.
  • Private groups. Other players don't see or use your groups unless you share them: look at a player and press G.
  • Crafting and upgrading at any station (including "any one of these ingredients" recipes), and building with the hammer, hoe and cultivator.
  • Machines: smelter, blast furnace, charcoal kiln, windmill, spinning wheel, eitr refinery, cooking stations, fermenters, fires/torches/braziers, shield generators and ballistas. E with nothing to add takes one from the machine's group; Shift+E fills the slot to capacity, mixing types if needed. Smelter-type machines and shield generators can also be set to Keep filled from chests.
  • A small in-game menu (G) to put things in groups, plus bulk tools for whole storage rooms.
  • Flashing yellow amounts in the crafting and build menus when your chests cover what you're missing.
  • Optional markers and lines that show which chests belong to which group and what pulls from what.
  • Optional ground pickup. Drop a pile next to your storage, and each item goes into a nearby chest that already holds that item, with a little wisp showing where it went.
  • Built to never duplicate or delete items. See Item safety.

Installing

With r2modman or the Thunderstore Mod Manager (easiest)

  1. Open your mod manager and pick your Valheim profile.
  2. Go to Online, search for Craft From Container Groups, and click Download. BepInEx is installed automatically.
  3. Click Start modded.

By hand

  1. Install BepInExPack Valheim if you don't already have it.
  2. Download CraftFromContainerGroups.zip from the Releases page.
  3. Open the zip and copy CraftFromContainerGroups.dll into Valheim/BepInEx/plugins/.
  4. Start the game.

Multiplayer

  • Every player who wants to put things in groups or pull from chests needs the mod. Players without it just see normal chests.
  • The server doesn't need it. Groups are saved on the objects themselves.
  • Groups are private: only you and the players you share a group with can see it, use it, or put things in it.
  • Don't run this together with another "craft from containers" style mod. They change the same parts of the game.

Quick start

  1. Look at your forge and press G. Type Forge and press + New. The forge is now in the group Forge.
  2. Look at a chest with metal and wood and press G. Click Forge so it turns green.
  3. Empty your pockets, open the forge and craft. The materials come out of that chest.

Doing a whole storage room? Look at one chest that's already in the right group, press G, pick 6m under Add nearby to Forge, and press +N on the Containers line.


The G menu

Looking at a chest, crafting station or smelter

Stand within reach of it, as if you were going to press E, and press G.

┌ Forge ─────────────────────────────────┐
│ [Food] [Forge] [Metal]         │ In:   │
│ [Smelting]                     │ Forge │
│ [____________________] [+ New] │ Metal │
│                                         │
│ Add nearby to Forge, Metal: (3m)(6m)(10m)│
│ Containers (12)           [+8]  [-2]    │
│ Crafting stations (2)     [+1]  [-0]    │
│ Smelters & machines (3)   [+3]  [-0]    │
│ [x] Only things I built                 │
└─────────────────────────────────────────┘
  • Click a group to add the object to it or take it out. Green means it's in that group, and the panel on the right lists its groups.
  • + New (or Enter) creates a group and adds the object in one step.
  • Drop food when done (cooking stations and ovens): finished food is pushed out the front as soon as it's cooked, so it never burns. With ground pickup on, it goes into a chest that already holds that food.
  • Pullable from PlanBuild (chests, with PlanBuild installed; on the right under the groups): PlanBuild's plan pieces may take materials from this chest. Off by default, so plans never touch a chest you haven't marked. See PlanBuild plans.
  • Leave 1 of each item in this chest (chests): pulling never takes the chest's last one of anything, so ground pickup still knows what goes there.
  • Pull amount (smelters, kilns, furnaces, refineries, shield generators): type a number and press Pull. The machine pulls that many from its group as it makes room (10 ordered into a smelter at 5/10 = 5 now, 5 more as it smelts), then stops. Ore orders also add just enough fuel. Cancel stops it.
  • Keep filled from chests (smelters, kilns, furnaces, refineries, shield generators): every few seconds the machine's ore and fuel are topped up from its group. Saved on the machine, so everyone sees it. Only the player whose game currently controls the machine feeds it (never two at once), it pauses while your inventory is open, and it needs a free inventory slot because items pass through your inventory like any other pull.
  • Add nearby to ... gives things within 3, 6 or 10 m the same groups (+N) or takes them away (-N). The numbers show how many things each button would change.
  • G again or Esc closes it. While it's open the game ignores its own keys, so typing doesn't open the map or inventory.

Looking at another player

Not tested with two players yet. Sharing has only been tried on one game so far; two-player testing is planned for the next few updates. If something doesn't work, please open an issue with both players' LogOutput.log.

Press G while looking at another player. The Add to groups screen lists your groups as buttons. Click one to share it with that player (it turns green), and click again to stop sharing. + New makes a group and shares it in one go.

  • They need this mod, and you both need to be online. If they're offline when you stop sharing, it reaches them the next time you're both on.
  • They can use the group and put things they built in it or take them out. Only you can rename, delete or share it.
  • This keeps your groups private between players with the mod, but it isn't a lock: to keep items safe from other players, use private chests or wards. The mod respects both.

Looking at nothing

Press G while not looking at anything:

  • Show group markers: a small, dim ball above each grouped object, one per group, in that group's color.
  • Show what pulls from what: thin lines from chests to the stations and smelters that use them.
  • Chests pick up matching items nearby: turns ground pickup on or off.
  • New chests I build go in: groups that every chest you build joins automatically. Add my N loaded chests to it catches up the chests you already have nearby.
  • Manage groups: rename or delete your groups. Renaming a private group is instant everywhere, and players you share it with see the new name. Deleting takes it off things near you right away and off the rest of your base the next time you're near it. Groups shared with you are listed with who shared them.
  • Make my public groups private: groups made before private groups existed are public (everyone sees them). This turns them into private groups with the same names. Anyone else who used them needs them shared back.

Markers and lines are only on your screen and are kept light (only things within 30 m, updated twice a second).


How groups work

You're using... It pulls from...
A crafting station (workbench, forge, cauldron, ...) Chests that share a group with that station
The hammer, hoe or cultivator Chests that share a group with the workbench/station whose build area you're in
Crafting from your inventory (torches etc.) Chests that share a group with stations around you
A smelter, kiln, cooking station, fermenter, fire, shield generator... (E with nothing to add, Shift+E to fill) Chests that share a group with that machine
  • Chests with no group are never used.
  • If your inventory, or storage another mod adds (an equipped backpack, for example), already covers the cost, chests aren't used at all.
  • Stations and machines with no group don't pull from anything.
  • Private chests that aren't yours, chests someone has open, and chests inside a ward you can't use are always skipped.
  • Chests must be within 20 m (setting: Range).

Epic Loot enchanting table

With Epic Loot installed, the enchanting table works like a crafting station:

  1. Look at the enchanting table, press G and put it in the group of the chests that hold your dust, essences, reagents and runestones.
  2. Open the table. Enchanting, augmenting, converting, disenchanting, runes and table upgrades take what's missing from those chests after your inventory.
  • Only materials come from chests. Gear stored in chests never shows up at the table, so nothing in storage can be sacrificed or changed by accident.
  • The table only counts chests your game controls. Right after opening it, an amount can take a moment to appear while the chests are asked for.
  • Uses Epic Loot's own support for storage mods. Switch it off with EpicLootEnchantingTable in the settings.

PlanBuild plans

With PlanBuild installed, plan pieces can take their materials from chests you choose:

  1. Look at a chest, press G and tick Pullable from PlanBuild (on the right, under the groups). The chest also has to share a group with the workbench you're building near.
  2. Look at a plan piece and press E or hold E, as usual.
  • Hold E pulls each material up to what that one piece still needs, or what the marked chests hold if that's less. A wall that needs 2 more wood takes 2, never the rest of your wood.
  • E adds one item. A chest is only used when you carry none of the piece's materials.
  • Whatever the plan doesn't take goes straight back to its chest. Chests without the switch are never used for plans.
  • The number keys (add a chosen hotbar item) and the plan totem work exactly as in PlanBuild.

Ground pickup (optional)

Off until you turn it on (G at nothing, or the config).

  • Every few seconds, items on the ground within 10 m of a grouped chest go into that chest, if it already holds at least one of that item.
  • Items you drop yourself are included. That's the point: drop a pile next to your storage and let it sort itself.
  • Only stackable items by default (wood, ore, food, trophies...). Weapons, tools and armor you set down stay on the ground.
  • A small wisp drifts from each item to the chest it went into, and you hear the chest close sound once per batch.
  • Carts and ships pick up too, including custom ones that use the normal storage. A ship picks up while you're sailing it or nobody is aboard; a cart while you pull it or nobody is pulling it.

Item safety

Not duplicating or deleting items is the top priority. Here's how the mod avoids it:

  • Items go into your inventory first. Right before a craft, build or smelter feed, the mod moves exactly what you're missing into your inventory. The game's own code then pays for it like normal. If anything fails, the items are simply in your inventory.
  • Unused items go back. If the craft, placement or smelter feed doesn't happen (no room, bad build spot, smelter full), the items return to the chest they came from.
  • Chests are asked for, never grabbed. Valheim only saves changes made by whoever currently "owns" a chest. The mod asks for ownership the same way the game does when you open a chest. The owner sends the newest contents first and refuses if the chest is open.
  • Check first, then move. If your chests can't cover the whole cost, nothing moves. If a move fails halfway, everything already moved is put back.
  • It counts what actually arrived. The game's "add item" can add part of a stack and still say it failed, so the mod counts the real result every time.
  • Nothing silently vanishes. If an item can't go back into its chest, it stays in your inventory, or as a last resort it's dropped at your feet.
  • Open chests are never touched. If what you need is only in a chest someone has open, you're told who ("player is using that chest") and nothing moves.
  • Display numbers can be a moment old; moves never are. The counts in the menus are refreshed a few times a second, but every actual move re-scans and re-reads the chests first.
  • Everything is logged to BepInEx/LogOutput.log as [Transfer] and [Ground] lines.

One thing no mod can prevent: Valheim saves your character on your PC and the world on the server. If your connection drops right after any chest transfer, including one you do by hand, the two can disagree. This mod uses the same steps as a normal chest transfer, so it's never riskier than doing it by hand.


Settings

Change them in game with ConfigurationManager (F1), in r2modman's Config editor, or in BepInEx/config/craftfromcontainergroups.cfg. Most take effect immediately.

Section Setting Default What it does
1 - General Enabled on Master switch
MenuKey G Opens the group menu
Range 20 m How far chests can be for crafting, building and smelters
2 - Groups BulkOnlyMyChests on "Add nearby" only changes things you built
3 - Features PullForCrafting / PullForBuilding / PullForSmelters on Turn each kind of pulling on or off (PullForSmelters covers all machines)
4 - Menu UiScale 0 (auto) Menu size; try 1 to 2
ButtonsPerRow 3 Group buttons per row
5 - Display FlashColor / UnflashColor yellow / white Colors of the flashing amounts
ShowAvailableAmount on Show amounts as available/needed
ShowMarkers / ShowLinks off Markers and lines (also in the G menu)
VisualRange 30 m How far markers, lines and wisps are shown
MarkerBrightness 0.55 How bright markers, lines and wisps are
6 - Ground pickup Enabled off Ground pickup on or off (also in the G menu)
PickupRadius 10 m How far from a chest items are picked up
CheckEverySeconds 1 How often it looks
OnlyChestsInAGroup on Only grouped chests pick things up
OnlyChestsIBuilt off Only chests you built pick things up
IncludePlayerDropped on Include items players dropped
StackablesOnly on Leave weapons, tools and armor alone
ShowWisp / PlaySound on The wisp and the chest sound
7 - Logs LogTransfers on Write every move this mod makes to the log
LogOtherPlayers on Log what other players' games do to your chests, machines and cooking stations
KeepLogBetweenSessions on Keep the log when the game restarts (from the next launch). The file keeps growing
8 - Mod compatibility KeepChestAmountsVisible off For mods that change the crafting or build panels (ZenUI, for example): turn on if the flashing chest amounts don't show
EpicLootEnchantingTable on Epic Loot's enchanting table can be grouped and pays for its materials from chests in its groups (restart to apply)
PlanBuildPlans on PlanBuild's plan pieces can take materials from chests marked "Pullable from PlanBuild" (restart to apply)

Troubleshooting

Nothing is pulled from my chest. Check that the chest and the station share a group: G on each, and look at the In: panel. For building, the workbench you're standing near needs the group. Also check the chest is within 20 m.

"Getting chest access, try again" Another player's game currently controls that chest (usually whoever is standing closest). The mod has asked for it; try again after a second.

"player is using that chest" What you need is only in a chest someone has open. The mod never touches an open chest; try again when they close it.

Ground pickup doesn't take something. The chest needs at least one of that item already, and has to be in a group. The log has a [Ground] line explaining what was skipped and why.

Where's the log? BepInEx/LogOutput.log in your game or r2modman profile folder. In r2modman: Settings → Browse profile folder → BepInEx. With KeepLogBetweenSessions on, it holds every session since you turned it on; each one starts with a Craft From Container Groups ... loaded line and the date.

Found a bug? Open an issue and attach your LogOutput.log.


Credits

  • Inspired by aedenthorn's Craft From Containers (public domain), including the idea of flashing requirement amounts.
  • Written with Claude (Anthropic).

License

MIT

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