You are viewing a potentially older version of this package. View all versions.
KorThunder-CraftFromContainerGroups-0.10.1 icon

CraftFromContainerGroups

Craft, build and feed smelters from chests you put in groups. Multi-group chests, bulk tagging, markers, optional ground pickup. Item-safe.

Date uploaded 4 days ago
Version 0.10.1
Download link KorThunder-CraftFromContainerGroups-0.10.1.zip
Downloads 252
Dependency string KorThunder-CraftFromContainerGroups-0.10.1

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

CHANGELOG

Changelog

0.10.1

New

  • Carts and ships pick up items from the ground, like chests: put them in a group, and they take items they already hold at least one of. Custom carts and ships that use the normal storage work too.
    • A ship picks up while you're sailing it, or while nobody is aboard. With someone else aboard, it's left alone.
    • A cart picks up while you pull it, or while nobody is pulling it.
  • Mod compatibility section at the bottom of the settings, for options that only matter alongside other mods. Everything in it is off by default.
    • KeepChestAmountsVisible: for mods that change the crafting or build panels (ZenUI, for example). Turn it on if the flashing yellow chest amounts don't show when a recipe or piece is selected.
    • EpicLootEnchantingTable (on): Epic Loot's enchanting table can be put in groups with G. While its window is open, chests sharing a group with it pay for its materials: enchanting, augmenting, converting, disenchanting, runes and table upgrades. Your inventory is used first. Only materials: items stored in chests can't be sacrificed or changed at the table. Does nothing without Epic Loot.
    • PlanBuildPlans (on): PlanBuild's plan pieces can take materials from chests switched to Pullable from PlanBuild (new switch on the right of a chest's G menu). Only those chests are used, and only when they share a group with the workbench you're near. Hold E pulls up to what that one piece still needs; E pulls one item when you carry none of its materials. Whatever the plan doesn't take goes back. Does nothing without PlanBuild.

Fixes

  • Carts and ships you built count as yours for Only chests I built, Only things I built and private groups.
  • Pulling for crafting or building never asks for a cart someone else is pulling or a ship someone else is aboard, so it can't take the cart or ship away from them.
  • Works alongside backpack and storage mods. When your inventory, or storage another mod adds (an equipped backpack, for example), already covers a craft or a build, chests aren't touched and that mod pays the way it normally does. Building near a grouped workbench is no longer refused when the materials are in that storage.

Faster

  • Dropping an item, moving one or crafting no longer redraws the crafting list a second time right after the game redraws it. With many recipes (big content mods), each redraw was a noticeable hitch.
  • With no grouped chests in range, changes to your inventory never redraw the crafting list.
  • Chest scans skip out-of-range and ungrouped storage before looking inside it.
  • Working out which chests to get ready while a menu is open goes through every recipe only when your inventory or station changes.
  • Ground pickup only looks through chests when an item on the ground could actually be stored.

0.10.0

New

  • Private groups. New groups are private: other players with the mod don't see them, can't use them, and can't put things in them or take things out.

  • Share a group: look at a player and press G. "Add to groups" shows your groups as buttons; click one to share it with that player (it turns green), click again to stop. Players you share with can use the group and add or remove things they built. Only you can rename, delete or share it.

    • Not tested with two players yet. Two-player testing is planned for the next few updates.
  • Renaming a private group is instant everywhere (things store the group's id, not its name).

  • Groups from before are public. Make my public groups private under Manage groups converts them.

  • Audit log (log only, LogOtherPlayers in the Logs section). [Audit] lines for what other players' games do near you:

    • your chests (grouped, or built by you) changing while another game controls them: what came and went, whose game, and how far away that player was;
    • smelter-type machines and shield generators: ore queued and fuel added by another game, with a warning when the ore isn't something that machine accepts in a normal game;
    • cooking stations and ovens: food put on or taken off while another game controls them;
    • network messages your game doesn't understand: who sent them and to what (a mod on the sender's game).
  • Logs section at the bottom of the settings: LogTransfers, LogOtherPlayers, and KeepLogBetweenSessions (on by default), which keeps LogOutput.log when the game restarts instead of starting a new one, so a problem from earlier can still be looked up or sent with a bug report. It sets BepInEx's own AppendLog setting and works from the next launch; the file keeps growing while it's on. Each session starts with a line showing the date and time.

  • Ballistas: put them in a group and E loads a bolt from the group's chests, Shift+E fills them, and Keep filled / Pull amount work too. A ballista holds one kind of ammo at a time, so a fill only takes the kind already loaded (or, if empty, the first kind your chests have).

  • Drop food when done (cooking stations and ovens, in their G menu): finished food is pushed out the front the moment it's cooked, so it never burns. With ground pickup on, it goes straight into a chest that holds that food.

Fixes

  • Changing groups (or Keep filled, Pull amount, Leave 1) on something another player's game controls didn't stick when that player doesn't have this mod. It now takes effect for you right away, the menu shows "Saves when <player> leaves", and it's saved on the object as soon as your game controls it.
  • Shift+E on fires and torches stopped one short when your game controlled the fire.
  • Changing a thing's groups never removes other players' private groups from it.
  • Audit lines say "your game" instead of "You's game".
  • Menus update live. While the crafting menu or a build menu (hammer, hoe, cultivator...) is open, what you can make updates as you move: walk out of range of the wood chest and wood things grey out, walk back and they light up again. Same when you run out of an item, when chests change, or when you leave a grouped workbench's area. No more closing and reopening.

Faster

  • Ground pickup works out once per check which chests hold which items, instead of searching every chest for every item on the ground.
  • Chest checks and ground pickup do less work every frame.
  • The audit log only watches your own chests.
  • With the crafting menu or a build tool out, the mod only asks for control of chests that hold something you're actually missing, instead of every grouped chest in range. Other players keep their chests longer.

Other

  • Settings: LogTransfers moved from "6 - Safety" to "7 - Logs", and Ground pickup is now "6 - Ground pickup". Your values carry over.
  • Groups set with 0.9.0 or older that were never re-saved since are no longer read. Those things just show no group (items are not affected); add them to their group again. The pre-0.9.1 settings file is no longer copied over.

0.9.5

  • Leave 1 of each item (per chest, in the chest's G menu): crafting, building and machines never take a chest's last one of anything, so ground pickup still knows what belongs there.
  • Pull amount (smelters, kilns, furnaces, refineries, frost kiln, shield generator): type a number and press Pull. It pulls that many from the group over time, as the machine makes room, then stops. Ore orders also add just enough fuel to smelt them. The hover text shows how many are still to come; Cancel stops it.
  • Audit log (with LogTransfers on): for smelter-type machines your game controls, [Audit] lines record every ore added and whose game added it, every item finished, and whenever control of a machine passes to another player. Useful for finding out what another mod is doing to your machines.

0.9.4

  • Rename and delete groups: G while looking at nothing, then Manage groups. Things near you change right away; things elsewhere in your base change the next time you're near them.

0.9.3

  • Shield generators can be put in groups. E with nothing to add takes bones from the group; Shift+E fills it.
  • The G menu's "Smelters & processors" line is now "Smelters & machines" and includes shield generators.
  • Shift+E now fills the slot to its capacity from chests, mixing types (copper, then tin, then iron scrap...) instead of stopping when the first type runs out. It no longer stops one short.
  • New Keep filled from chests checkbox in the G menu for smelters, kilns, furnaces, refineries, windmills, spinning wheels and shield generators. Every few seconds the machine is topped up from its group (ore and fuel). Only one player's game feeds a machine, and it pauses while your inventory is open.

0.9.2

  • Fixed: recipes you can craft from chests no longer show greyed out after crafting something.
  • Fixed: Shift+E on smelters and kilns now fills them instead of adding one.
  • Grouped machines show a "Shift + E Fill from chests" hint when you look at them.

0.9.1

  • New internal plugin ID; the settings file is now craftfromcontainergroups.cfg. Your old settings are copied over automatically, and existing group assignments are kept.
  • Players need the same version to set groups on objects another player controls.

0.9.0

  • More machines: cooking stations, fermenters, and fires/torches/braziers pull from their group. The G menu's bulk tools have new "Cooking & brewing" and "Fires & lights" lines.
  • Shift+E fills smelters, kilns, cooking stations and fires to capacity from their group. Whatever doesn't fit goes back to the chests.
  • "Any one of these ingredients" recipes now pull from chests too.
  • "player is using that chest": when what you need is only in a chest someone has open, you're told who.
  • Faster in big bases: menu counts are cached for a fraction of a second; actual moves always re-check the chests first.
  • Machines you're looking at get their chests ready in the background, so the first E usually works straight away.

0.8.0

  • Ground pickup shows where items went: a small wisp drifts to the chest, and the chest close sound plays once per batch.
  • Items players drop are now picked up too (IncludePlayerDropped).
  • Ground pickup has its own radius (PickupRadius, default 10 m). By default it uses any chest in a group, whoever built it.
  • Adding items to chests and inventories now counts what actually arrived, since the game can add part of a stack and still report a failure.

0.7.0

  • Optional ground pickup: chests pick up nearby items they already hold.

0.6.0

  • Bulk tagging: give nearby containers, crafting stations or smelters the same groups (3/6/10 m).
  • Default groups for chests you build, plus a button to catch up existing chests.
  • Game keys are ignored while the G menu is open.
  • Finds machines whose parts sit on separate pieces of the model.

0.5.0

  • Group markers and "what pulls from what" lines (only on your screen).
  • The G menu shows an object's groups on the side; hover text removed.
  • Pulled items go back to their chest if the craft, placement or smelter feed doesn't happen.

0.4.0

  • Objects can be in several groups; things that share a group work together.
  • Simpler, smaller G menu.

0.3.0

  • Rebuilt pulling for item safety: items move into your inventory before the game's own code runs, chest ownership is requested the vanilla way, and every move is checked, logged and undone on failure.
  • Flashing yellow requirement amounts with available/needed.

0.2.0

  • First version.