GungnirStaff

版本 v1.0.3·更新於 2026-08-30

Odin's spear, craftable at the Galdr Table. Carries your magic staffs inside itself and becomes whichever one you select.

模組介紹 作者原文

Gungnir Staff

A Valheim mod that adds Gungnir, Odin's spear — a Mistlands-tier weapon that

carries other magic staffs inside itself and becomes whichever one you select.

Built on BepInEx 5.4.23.3 + Jötunn 2.29.2, targeting net462 (the framework

Jötunn and Valheim's Unity Mono runtime use).

Source:

What the mod does

Gungnir is craftable at an upgraded Galdr Table and behaves as a spear in the

hand — full vanilla attacks, throwing, animations and colliders, because the item is

a runtime clone of a vanilla spear with its own model, damage and flavour text

applied on top.

Its own trick is the staff rack: a one-row inventory that lives inside the item.

Drop a magic staff into the rack, select the slot, and Gungnir turns into that staff

— its attack, eitr cost, projectile, skill XP, icon and held model all become the

staff's. Holster, and it is a spear again. A new Gungnir has four rack slots and each

upgrade adds two (4 → 6 → 8), so the item's quality is what governs how many staffs it

carries.

The crystal in the butt of the spear is colour-coded per staff, with a matching light

and a shoal of motes around it, so you can see which staff is loaded at a glance.

Layout

GungnirStaff.sln

Directory.Build.props # all machine paths live here

Environment.props.example # copy -> Environment.props to override paths

GungnirStaff/

GungnirStaff.csproj # references, embedded bundle, deploy targets

Plugin.cs # BepInEx entry point, Harmony patch/unpatch

ModConfig.cs # every user-facing setting

Inputs.cs # rebindable KeyboardShortcuts

Localizations.cs # $token translations

Alive.cs # "is the mod alive?" status reporting

Commands.cs # gungnir dev console command

Blueprint.cs # one-shot dump of a vanilla prefab's components

GungnirItem.cs # the item prefab, cloned from a vanilla spear

GungnirStandalone.cs # the same prefab built from nothing, no clone

GungnirRecipe.cs # recipe + three upgrade levels

GungnirVisual.cs # swaps the custom model in from the AssetBundle

StaffRegistry.cs # what counts as a staff

StaffContainer.cs # the rack inventory, persisted in m_customData

StaffSwitcher.cs # the m_shared projection, plus durability write-back

GungnirBar.cs # the rack UI, cloned from vanilla's InventoryGrid

CrystalColors.cs # per-staff crystal colour config

CrystalGlow.cs # tints the crystal material and casts a light

CrystalParticles.cs # code-built motes and sparks around the crystal

Patches/PlayerPatches.cs # spawn hook, hotbar suppression

Patches/InventoryGuiPatches.cs # Ctrl+click a staff into the rack

Patches/RecipePatches.cs # exact per-level upgrade costs

Assets/gungnir # the AssetBundle (embedded into the DLL)

art/ # Blender source, FBX export, icon sources

tools/ # Dump-GameType.ps1, Verify-Patches.ps1

manifest.json # packaging metadata

Crafting

Made at the Galdr Table, level 2 — an upgraded table, unlike the basic staffs.

| Material | Craft | Lv 2 | Lv 3 |

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

| Yggdrasil wood | 30 | 15 | 25 |

| Refined eitr | 30 | 20 | 30 |

| Thunder stone | 3 | 2 | 4 |

| Black core | 2 | 1 | 2 |

| Rack slots | 4 | 6 | 8 |

Three levels rather than four, because the levels exist to buy rack slots and the rack

is full at level 3. The 8-slot ceiling is itself pinned by the Alt+1…Alt+8

shortcuts, so a fourth upgrade could only have cost materials and granted nothing.

Black cores gate it behind actually delving the Infested Mines rather than gathering

on the surface.

Vanilla computes an upgrade requirement as m_amount at level 1 and

(level - 1) * m_amountPerLevel above it, a curve that cannot produce the thunder

stone progression 1, 2, 3, 4 at any setting. RecipePatches.cs substitutes the exact

numbers, keyed on the requirement instance, so no other recipe in the game is

touched.

Material names are resolved against ObjectDB rather than assumed — Valheim's asset

manifest carries both ThunderStone and Thunderstone, and only one of them is the

item.

Controls

Defaults — every binding is rebindable

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

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

denikson-BepInExPack_ValheimValheimModding-Jotunn

檔案與校驗

檔案名稱
GungnirStaff-1.0.3.zip
檔案大小
223.7 KiB