Confirm with your password

DrakeModsLibs

Shared DrakeMods library for Valheim - Forge helpers, display patches, tags, APIs, and server config sync. Required by LockSmith and DrakesRenameit. Valheim 1.0 compatible.

· MIT license · 💗 Donate

Stars
0
Downloads
164
Version
0.11.2
Updated
Author
DrakeMods
Virus scan
✓ Scan successful
Runs on
Client (& Server)
Required by
4 mods

Compatibility

Required 1

Install these too — Gale pulls them in for you.
  • Jotunn ValheimModding ·2.30.2

Description

DrakeModsLibs icon

DrakeModsLibs — ⚠️ Moving to Hexium

[!IMPORTANT] DrakeMods is moving to Hexium.

This is one of the last updates we'll post on Thunderstore. No new DrakeMods will be released here, and existing mods will get only limited support on Thunderstore from now on.

For the latest updates, newest versions and future mods, follow us on Hexium: 👉 DrakeMods on Hexium

These Thunderstore listings will be deprecated after this.

[!TIP]

🎨 DrakesReskinIt is finally coming, on Hexium!

The next mod built on DrakeModsLibs: give any item a new inventory icon, a new equipped model and custom colors, with saveable presets. It plugs into the same Shift + right-click tab menu that LockSmith and DrakesRenameIt already use. 👉 DrakesReskinIt on Hexium

Shared library for DrakeMods Valheim mods. It owns the display Harmony patches, item custom-data helpers, tag gatekeeping, menu binding registry, and server config sync so feature mods stay smaller and stay compatible when the game updates.

DrakeModsLibs is published on its own so other DrakeMods (starting with DrakesRenameit) can depend on one common package. More customization-oriented mods may use it later; there is no full suite planned for release right now — priorities and a redesign pass come first. Reskin is something we still want to look into when time allows.

Valheim 1.0

This release targets Valheim 1.0 API changes (notably item-stand visual updates and related display paths). Install the matching DrakeModsLibs build with your feature mods so labels and hover text keep working after the 1.0 update.

Required for

  • LockSmith (shared Lock|Rename tabs, wood UI, config sync)
  • DrakesRenameit (and any future DrakeMods that share display / config sync)

Forge helpers (DrakeModsLibs.Forge)

ForgeTextures (images embedded in your DLL, flatten-proof), ForgeSprites (flat cut-out images) and ForgeLook (materials, icons, snap points, components, fire colours…): the API code generated by Drakes Asset Forge's plain C# export calls. Used by DrakesRenameit (paper). ForgeLook.Model (a .glb model from your DLL, like Forge's look.mesh.file) and ForgeLook.CollisionBox: used by DrakesItemShop (display case).

Server config sync (DrakeConfigSync)

Only DrakeModsLibs references and ILRepack-embeds ServerSync. Consumer mods must not add a ServerSync Thunderstore dependency or ILRepack step.

At startup, create sync via the API:

var sync = CustomizeLibsAPI.CreateConfigSync(modId, displayName, version);
var entry = sync.BindSynced(config, section, configurationManagerCategory, key, defaultValue, description);
sync.AddLockingConfigEntry(lockEntry);
sync.FinalizeBinding(log, expectedSyncedEntryCount, () => lockEntry.Value);

Use BindClientOnly for per-client settings (never registered with ServerSync). IsSourceOfTruth / SourceOfTruthChanged behave like the underlying ServerSync instance.

Soft-compat (CompatHost)

Optional foreign mods (WardIsLove, ProtectiveWards, Arcane Ward, DevCommands, …) are never hard dependencies. DrakeModsLibs provides per-plugin scaffolding:

  • DrakeModsLibs.Compat.ICompatModule / CompatPriority
  • CompatHost / CompatHosts.GetOrCreate(ownerGuid, log) — one host per Drake plugin GUID

Domain rules (ward access, paper take, item-stand names) stay in LockSmith / RenameIt. Built-in bridges there are a courtesy — not a promise to track every upstream ward change. Please report issues on those repos; pull requests and your own SoftDependency modules are welcome. LockSmith also exposes LockSmithCompatApi for third-party bridges.

Agent guidance: .cursor/skills/drakemods-compat-host/SKILL.md. WardIsLove RenameIt handover: docs/handover-wardislove-renameit.md.

Custom data API (other mods)

Read and dump ItemDrop.ItemData.m_customData through CustomizeLibsAPI:

  • GetCustomDataValue(item, key) — display value (tags → true/null, text → stored string)
  • GetCustomDataRaw(item, key) — raw dictionary value
  • DumpItemCustomData(item, options) — all keys, one mod, one key, JSON or neat text
  • DumpAllDrakeCustomData(item) / DumpItemCustomDataForMod(item, modId)
  • RegisterModCustomDataFields(modId, fields) — register your mod’s keys at startup

Built-in mod ids: DrakesRenameIt, DrakeModsLibs, DrakesQuestItems, DrakesItemShop.

Subscribe to CustomizationEvents.OnItemNameChanged for rename logging; use DrakeCustomDataKeys.Rename with GetCustomDataValue.

Tag gates (RenameIt integration)

Other mods talk to Libs only; RenameIt calls CanPerform / IsRenameInventorySuppressed and never needs a new release for your tags.

Built-in tag Blocks Inventory UI Admin bypass
Drake_NoRename rename suppress soft (yes)
Drake_NoDesc description — soft (yes)
Drake_NoCraftedByEdit crafted-by — soft (yes)
Drake_QuestItem all edits suppress soft (yes)
Drake_HardNoRename rename suppress hard (no)
Drake_HardNoDesc description suppress hard (no)
Drake_HardNoCraftedBy crafted-by suppress hard (no)
Drake_Immutable all edits suppress hard (no)
Deferred (DeferEditsTo) chosen ops optional authority decides
// Soft stamp (admin/VIP TagBypass may still allow)
CustomizeLibsAPI.BlockRename(item);

// Hard stamp (LockSmith-style safety — no admin bypass)
CustomizeLibsAPI.HardBlockRename(item);
// or
CustomizeLibsAPI.MarkImmutable(item);

// Deferred: owning mod is in charge (not never, not hard-never)
CustomizeLibsAPI.RegisterDeferredEditAuthority(
    "LockSmith",
    CustomizeOperation.RenameName | CustomizeOperation.RenameDescription,
    (item, player, op) => /* your policy */ true);

CustomizeLibsAPI.DeferEditsTo(
    item,
    "LockSmith",
    CustomizeOperation.RenameName,
    suppressRenameInventoryUi: true); // Relabel owns inventory menu

// Whole prefab family at startup (no per-drop stamp)
CustomizeLibsAPI.RegisterItemExclusion(
    "masterkey",
    CustomizeOperation.RenameName,
    suppressRenameInventoryUi: true,
    hardLock: true);

CustomizeLibsAPI.RegisterItemDeferral(
    "CryptKey",
    "LockSmith",
    CustomizeOperation.RenameName,
    suppressRenameInventoryUi: true);

// Custom tag rule at startup (RenameIt picks it up automatically)
CustomizeLibsAPI.RegisterTagBlockRule(
    "Drake_MyMod_LockBound",
    CustomizeOperation.RenameName,
    suppressRenameInventoryUi: true,
    hardLock: true);

Soft blocks still respect RenameIt admin/VIP TagBypass for CanPerform. Hard locks, deferred authority, and inventory UI suppress do not auto-apply bypass. Direct SetCustomName still works for an owning mod’s Relabel UI.

Stack merge policy

Register one consumer policy with CustomizeLibsAPI.RegisterStackMergePolicy. Libs then owns inventory merge:

  • SeparateStacksEnabled / SeparateStacksHardLock — global fingerprint merge
  • GetStackForce(item) — per-item override that ignores those globals (no TagBypass)
public DrakeStackForce GetStackForce(ItemDrop.ItemData? item)
{
    // None = follow SeparateStacks; ByIdentity = always fingerprint; Never = never auto-merge
    return DrakeStackForce.None;
}

When two items disagree, Never wins over ByIdentity over None.

Shared wood UI + tab host

RenameIt-looking chrome lives in DrakeModsLibs.UI:

  • DrakeWoodActionMenu, DrakeConfirmPanel (300×178 at default size), DrakeTextPromptPanel
  • DrakePanelOptions (Width, MinHeight, MaxHeight, ButtonWidth, ButtonHeight, RowGap) — optional constructor argument on DrakeWoodActionMenu and DrakeConfirmPanel. Panels size to their content between min and max; content past max scrolls. Omit it for today's sizes.
  • DrakeGuiInput / DrakeButtonSfx
  • DrakeSlider: labeled float slider (label / track / value text), layout-driven; Create(parent, pos, label, min, max, initial, onChanged, format, width). Used by ReskinIt's brightness boost.
  • DrakeNumericStepper (− / field / +) with SetRange / SetInteractable
  • DrakeTabHost — Craft|Upgrade-style top-right tabs; only registered (installed) mods get a tab. Rename baseline priority is low; feature mods claim default (e.g. Lock on keys). Defer/suppress hides Rename entirely.

Cross-mod knobs: BepInEx config section Integration (DrakeIntegrationConfig) — shared inventory open modifier, TabPriorityOverrides (id=priority;…), ForceDefaultTabId, DisableClaimDefault. Feature mods keep gameplay-only config.

Inventory open + hints (Libs): InventoryOpenModifier + right-click opens DrakeTabHost when any usable tab exists for the item (permission-aware IsAvailable). Yellow interact line:

  • 1 usable tab → that mod’s localized getHintPhrase (e.g. LockSmith “configure lock tool”, RenameIt “edit”)
  • 2+ usable → Libs localized customize Do not put those phrases in Libs — register getters from each feature mod. Tab strip appears only when usable count ≥ 2.

RenameIt handoff: Register tab renameit with your localized hint; IsAvailable must respect suppress and TagBypass (admin may get usable=2 on Locksmith keys). Drop competing “for options” tooltip/open once Libs consumes usable ≥ 1.

Item looks (ReskinIt)

  • ItemLookService.MaxTintBoost / BoostOf: model and icon tints may carry a brightness boost (channels above 1, up to 4x), saved as RRGGBB*2.50. Used by ReskinIt's brightness slider. Skin-tight chest/leg armor (painted on the body) is tinted too.

Install

  1. Install BepInEx and Jotunn (see Thunderstore dependencies).
  2. Install DrakeModsLibs.
  3. Install feature mods that depend on it (e.g. DrakesRenameit).

Team: DrakeMods · Contact: Drakethos (Discord / email in the RenameIt page).

Publishing (GitHub Actions)

Pushing a tag v{Version} that matches <Version> in mod.package.props runs .github/workflows/release.yml:

  1. Build the Thunderstore zip and create a GitHub Release with the zip attached
  2. Publish that zip to Thunderstore (DrakeMods-DrakeModsLibs)
  3. Publish the same zip to Hexium (valheim.hexium.gg) after Thunderstore succeeds

Repo secrets required:

Secret Source
THUNDERSTORE_TOKEN Thunderstore team service account for DrakeMods
HEXIUM_TOKEN Hexium team API token for DrakeMods (team settings)

Changelog

DrakeModsLibs

0.11.2 Latest
  • Fix: the 0.10.1 VIP check was inverted. IsSourceOfTruth is true while the local config is in charge and turns false once the host's synced config arrives. 0.10.1 trusted a remote client's VipList only while it was still true, so an unsynced client could still grant itself VIP, and real VIPs on a remote or dedicated server lost VIP once synced. A remote client now trusts VipList only after the host's config has taken over. Host and offline play are unchanged.
  • No API changes.
0.11.1
  • Fix: synced settings changed while the game runs never reached players on Valheim 1.0. The bundled ServerSync was built when ZRoutedRpc.Everybody was a static field; Valheim 1.0 made it a constant, so ServerSync's broadcast threw MissingFieldException on every synced setting change (an admin editing config, or a mod migrating a value at startup). The bundled ServerSync is patched to use the constant, as a rebuild against 1.0 would (DrakesWorkshop scripts/Patch-ServerSyncEverybody.ps1).
  • No API changes. Consumers pinned to 0.10.x or 0.11.0 keep working and get the fix by updating Libs.
0.11.0
  • Custom models from Drakes Asset Forge (DrakeModsLibs.Forge):
    • ForgeLook.Model(assembly, prefab, file): shows a .glb model embedded in the calling mod's DLL (or beside it) instead of the prefab's own meshes, like Forge's look.mesh.file. Each submesh becomes a renderer named glb{i}_{mesh name}, with a copy of the base's material named after the .glb material, so ForgeLook.Material can restyle it by that name.
    • ForgeLook.CollisionBox(prefab, center, size): one box collider instead of the prefab's solid colliders (Forge's look.collision box). The originals are switched off; triggers stay.
    • Drakes Asset Forge's plain C# export with "Use DrakeModsLibs" now writes these calls. Used by DrakesItemShop's display cases.
  • New API only, nothing removed. Consumers pinned to 0.10.x keep working.

19 older entries, full version history & downloads →

Manual download
Just this mod One .zip — DrakeModsLibs 0.11.2
Files you'll get 2
  • DrakeModsLibs 0.11.2 DrakeMods this mod Get
  • Jotunn 2.30.2 ValheimModding Get

Your browser may ask permission to download several files at once. How to install these manually

Manual installation instructions
1

Install BepInExPack Valheim

BepInExPack Valheim is required to run mods in Valheim.

Download BepInExPack Valheim 5.4.2351 · View mod page

Check out the mod page for detailed installation instructions.

2

Install DrakeModsLibs

This mod must be installed on the client. Installing it on the server is optional (e.g., for config syncing).

Download DrakeModsLibs 0.11.2

Extract the ZIP and place the file(s) into the BepInEx/plugins/ folder inside your Valheim game folder.