GungnirStaff
Odin's spear, craftable at the Galdr Table. Carries your magic staffs inside itself and becomes whichever one you select.
About this mod Author’s original text
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
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.
Install these first, or the mod will not work: