McAutoStore

版本 v1.2.2·更新於 2026-09-14

One key stores your inventory into nearby containers, and dropped items are pulled in when a container already holds them. No item loss.

模組介紹 作者原文

McAutoStore

One key stores your inventory into nearby containers. Dropped items on the ground are

pulled in too — but only into a container that already holds that same item.

What it does

Store on keypress. Press. (configurable) and every item in your inventory goes

into the nearest container that can take it.

Ground pickup. Items lying near you are moved into containers automatically. The

rule is strict on purpose: a container must already hold that item, otherwise the

item is left on the ground. Your loot never gets scattered into random chests.

What it does NOT do

Stated up front so nobody installs it expecting something else:

  • No hotkey to store a single hovered item
  • No search command to find where an item ended up
  • No favourite / lock system for slots
  • No per-container YAML rules
  • No ServerSync between server and clients

If you want that full feature set, AzuAutoStore

does all of it and is a mature mod.

Configuration

BepInEx/config/joaorodrigues.valheim.mcautostore.cfg

| Option | Default | What it does |

|---|---|---|

| StoreKey |. | Key that stores your inventory |

| Range | 12 | Container search radius, in meters |

| OnlyMatchingContainers | true | Only store into a container that already holds that item. With false, any container with free space is used |

| SkipHotbar | true | Never store the first inventory row |

| SkipEquipped | true | Never store equipped items |

| IgnoredItems | Hammer,Hoe,Cultivator,SledgeStagbreaker | Prefab names that are never stored |

| ShowMessage | true | Show how many items were stored |

| PullFromGround | true | Pull dropped items into containers that already hold them |

| GroundRange | 12 | Radius scanned for dropped items, in meters |

| GroundScanInterval | 2 | Seconds between ground scans |

| GroundMinAgeSeconds | 3 | How long an item must lie on the ground first, so items you drop on purpose are not vacuumed instantly |

Why it does not lose items

This is the hard part of any auto-store mod, and it is worth explaining.

A container's inventory is a local cache. The truth is a serialized blob inside the ZDO,

and Container only writes that blob when you own the ZDO:

private void OnContainerChanged()

{

if (!m_loading && IsOwner()) Save();

}

If a mod writes into a container's inventory without owning it, Save() never runs, the

item exists only in local memory, and the container's CheckForChanges() — which ticks

every second — reloads the blob over it. If the mod already removed the item from the

player, the item is gone.

McAutoStore follows the same protocol the game itself uses in RPC_TakeAllResponse:

  • nview.ClaimOwnership() — take ownership
  • ZDOMan.instance.ForceSendZDO(...) — force the latest blob to sync
  • invalidate m_lastRevision and call Load() — re-read the real state before writing
  • only then AddItem, and only remove from the player when AddItem returned true

Step 3 is what keeps you from wiping what another player stored seconds earlier.

For ground pickup the same care applies to the item itself: ownership of the dropped

item's ZDO is claimed after a matching container is found and before the drop is

destroyed, so an item is never destroyed without having landed in a container first.

Multiplayer

Every player needs the mod. It works through ZDO ownership of the container, so it

behaves correctly with other players around, but installing it only on the server does

nothing.

Respects

  • Wards (m_checkGuardStone + PrivateArea.CheckAccess)
  • Private containers (creator only) and group containers (never)
  • Containers currently open by someone
  • Ships and carts (vehicle layer)

Compatibility

  • Valheim 1.0.12 (network 40)
  • BepInEx 5.4.2350

License

MIT.

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

denikson-BepInExPack_Valheim

檔案與校驗

檔案名稱
McAutoStore-1.2.2.zip
檔案大小
13.5 KiB