| name | bepinex |
| description | Develops BepInEx plugins with hooks, patches, and mod initialization for Unity games.
Use when: Creating BepInEx plugins, setting up plugin entry points, configuring mod settings, or integrating with Harmony patches.
|
| allowed-tools | Read, Edit, Write, Glob, Grep, Bash |
BepInEx Skill
BepInEx is the plugin framework for Unity game modding. This project uses BepInEx 5.x with .NET Standard 2.1 for SPT (Single Player Tarkov) modding. Plugins are loaded via [BepInPlugin] attributes and use ConfigFile for settings. All patches use Harmony (see the harmony skill).
Quick Start
Plugin Entry Point
[BepInPlugin("xyz.pit.fireteam", "pitFireTeam", "1.0.0")]
[BepInDependency("xyz.drakia.bigbrain")]
public class pitFireTeam : BaseUnityPlugin
{
public static ManualLogSource Log { get; private set; }
private void Awake()
{
}
}
Key Concepts
| Concept | Usage | Example |
|---|
| Plugin GUID | Unique identifier | "com.author.modname" |
| Hard dependency | Required mod | DependencyFlags.HardDependency |
| Soft dependency | Optional mod | DependencyFlags.SoftDependency |
| ConfigEntry | Runtime setting | config.Bind("Section", "Key", default) |
| ManualLogSource | Logging | Logger.LogInfo("message") |
Common Patterns
Soft Dependency Check
When: Integrating with optional mods like SAIN
private static bool _sainChecked;
private static bool _sainAvailable;
public static bool IsSAINAvailable()
{
if (!_sainChecked)
{
_sainAvailable = Chainloader.PluginInfos.ContainsKey("me.sol.sain");
_sainChecked = true;
}
return _sainAvailable;
}
Lifecycle Hooks
When: Responding to game events
private void Awake()
private void Start()
private void OnEnable()
private void OnDisable()
private void OnDestroy()
See Also
Related Skills
- harmony - Patching game methods
- csharp - Language patterns
- unity - MonoBehaviour lifecycle
- dotnet - Build and project configuration