ChestSnapping
Lets chests use Valheim's built-in snap system. Press Q/E while placing to pick one of 14 snap points. Works with modded chests, and the snap points can be adjusted in-game.
模組介紹 作者原文
Chest Snapping
Lets chests and other containers use Valheim's built-in snap system, the same way walls and floors do.
While placing a chest, press Q / E to cycle through its snap points. The normal message in the middle of the screen shows which one is active (for example Snapping: Bottom Front Left). Nothing about input or messages is re-implemented: vanilla already does the cycling and the message for any piece that has snap points. This mod just gives chests snap points.
Client-side only. Other players and servers do not need it.
Install
Requires BepInEx (BepInExPack_Valheim) and Jötunn. A mod manager such as Gale installs Jötunn for you.
Install with a mod manager, or put ChestSnapping.dll in BepInEx/plugins (Jötunn needs to be installed as well).
Snap points (cycle order)
| # | Name |
|---|------|
| 1-4 | Bottom Front Left, Bottom Front Right, Bottom Back Left, Bottom Back Right |
| 5-8 | Top Front Left, Top Front Right, Top Back Left, Top Back Right |
| 9-14 | Bottom Center, Top Center, Back Center, Front Center, Left Center, Right Center |
Points are placed on the chest's real collider bounds, so chests snap flush against each other. Front is the chest's local +Z and Right is +X, from the chest's own point of view. Names are localizable (English is provided, other languages fall back to English).
How to use it: pick a point on the chest you are holding (for example Bottom Back Right), aim near a snap point on another piece (another chest's corner or face center, or a wall/floor corner), and it locks on within vanilla's snap range (0.5 m). Rotation still matters: match the other chest's rotation with the normal rotate controls so the faces line up.
Built-in chests: piece_chest_wood, piece_chest, piece_chest_private, piece_chest_blackmetal.
Modded chests (or future vanilla chests)
No recompile needed. Use either way:
Console (F5)
| Command | What it does |
|---------|--------------|
| chestsnap_list [filter] | Lists every buildable container prefab and whether it has snap points. |
| chestsnap_add | Adds a prefab. Saved to the config, existing chests update immediately. |
| chestsnap_remove | Takes a prefab you added back off the list. |
Config file BepInEx/config/com.kydldev.ChestSnapping.cfg
- ExtraPrefabs: comma-separated prefab names.
- ExcludedPrefabs: prefabs that should not get snap points (also works for the built-in ones).
- AutoDetectContainers (default off): every buildable piece with a Container on its root (ships and carts excluded) gets snap points automatically. Good for big modpacks, use ExcludedPrefabs for anything it catches that you do not want.
Prefab names are not case-sensitive.
Adjusting the snap points
Some modded chests have an oversized invisible collider or an off-center model, which puts the snap points in the wrong place. Each chest can be tuned separately. All distances are in meters along the chest's own axes (+X right, +Y up, +Z front). Both 0.05 and 0,05 are accepted in the console.
| Command | What it does |
|---------|--------------|
| chestsnap_show [on\|off] | Draws a sphere on every snap point (yellow = corners, cyan = face centers). Session only. |
| chestsnap_info | Prints the measured box, the current adjustments and where each of the 14 points ends up. |
| chestsnap_shift x y z | Moves all points together. |
| chestsnap_grow x y z | Adds to the box's half-size per axis. 0.05 makes the box 10 cm bigger on that axis, negative values shrink it. |
| chestsnap_point x y z | Offsets a single point. ` is 1-14 (the Q/E order) or a name such as top_front_left`. |
| chestsnap_reset [point] | Clears the adjustments of a chest, or of just one point. |
Setting a value to 0 0 0 clears it. Changes apply to chests that are already standing, and are saved in the config.
Example for a chest whose collider is 10 cm too wide and deep:
chestsnap_list crate
chestsnap_add MyMod_Crate
chestsnap_show on
chestsnap_grow MyMod_Crate -0.05 0 -0.05
chestsnap_point MyMod_Crate top_center 0 0
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: