Skip to content
QinShenYu edited this page Jun 7, 2026 · 13 revisions

ScavLib — Scav Prototype Mod API Library

Current Version: 0.7.0

Authors: Kanisuko / QinShenYu

BepInEx GUID: com.kanisuko.scavlib


ScavLib is a foundational developer-focused API and utility library for Scav Prototype (a.k.a. Casualties Unknown). It provides safe, well-documented wrappers around the game's core systems so mod authors can focus on their features rather than boilerplate and null-checking.

Note for players: This is a dependency library. It adds no content on its own and is only needed if another mod requires it.


Requirements

  • BepInEx 5.x (64-bit recommended)
  • Scav Prototype (Steam)

Quick Navigation

Page Description
Getting Started Installation and your first mod
PlayerUtil Player vitals, state queries, drugs, last-stand, writes, and inventory
LimbUtil Per-limb health, bleeding, infection, and bone state
SkillUtil Skill levels, XP, global multiplier
ItemUtil World-space item scanning and manipulation
CustomItemRegistry Register custom ItemInfo definitions
EventBus Event-driven mod patterns + GetHandlerCount diagnostics
CommandRegistry Custom developer console commands + scavlib check
GUI uGUI + IMGUI menus
ConfigManager BepInEx config wrappers
ModRegistry Mod metadata, ModSession, and VersionedDependency
Lifecycle System IModLifecycle, world events, and mod callbacks
Changelog Version history
RecipeBuilder Register custom crafting recipes
CustomLiquidBuilder Register custom liquid types
LocaleRegistry Localize custom item, building, moodle, and misc strings

What's New in 0.7.0

  • Spawnable custom itemsCustomItemBuilder replaces metadata-only registration with a chainable Builder that clones a vanilla template Prefab, so Utils.Create(id, ...) and GameUtil.SpawnItem(id, ...) now resolve custom IDs at runtime. Vanilla Utils.Create is intercepted via a Priority.Low Harmony Prefix so other frameworks keep working.
  • RecipeBuilder — chainable API for adding entries to Recipes.recipes. Supports specific-ID and quality-based ingredients, liquid ingredients, and liquid or solid results, with the vanilla INT-skill failure curve preserved.
  • CustomLiquidBuilder — registers LiquidType entries into Liquids.Registry, with full support for OnDrink(float ml, Body body), OnHealthUse(float ml, Limb limb), injectable, and qualities.
  • LocaleRegistry — supplies translations for custom IDs without forking the game's Lang/EN.json. Patches Locale.GetItem / GetBuilding / GetMoodle / GetOther and preserves the vanilla current language → EN → bare id fallback chain.
  • Owner ledger everywhere — items, recipes, liquids, and locale entries all flow through the same owner-ledger pattern previously used by commands. scavlib check lists every registration with its owner mod and flags conflicts in one place.

All additions are purely additive. CustomItemRegistry.RegisterItem and RegisterSimpleItem still compile and run; they are marked [Obsolete] and do not bind a clone template.

See the Changelog for the full list and migration notes.


Verifying Installation

After placing ScavLib.dll in BepInEx/plugins/ and launching the game, open the developer console and run:

scavlib status

You should see ScavLib's version, authors, and all registered mods. Mods registered with a lifecycle object are annotated with [F].

Clone this wiki locally