# Plugin API

MudBringer's C# Plugin Architecture allows developers to extend the engine with compiled `.dll` libraries.
Plugins have "God-level" access to the engine state and can interact with parsing, variables, procedures, UI, and external events.
## Loading Plugins
Plugins are loaded via the `/loadlib` command:
`/loadlib {path/to/MyPlugin.dll}`
## Core Concepts
Type the following for more detailed documentation:
- **/help registerprocedure**: Injecting custom `@` procedures into the parsing engine.
- **/help plugin_state**     : Accessing and modifying engine state (Variables, Lists, Arrays).
- **/help plugin_lifecycle** : Hooking into connection and profile events.
- **/help executecommand**   : Executing client commands from a plugin.
## Plugin Options Configuration
If your plugin implements `IConfigurablePlugin`, you can expose custom configuration settings in the **Plugin Wizard**. The following advanced `PluginOptionType` options are supported:

- **StringList**: An editable, dynamic list of string entries (perfect for triggers, mutes, or audio catalogs). Separated in memory by pipes (`|`).
- **FilePath**: Renders a text box with a `Browse...` button that triggers a standard Windows File Dialog.
- **Choice**: Renders a clean dropdown selection menu populated with custom elements from `option.Choices`.
- **Color**: Renders an elegant dropdown selection displaying MudBringer's ANSI 16-color palette with live colored preview blocks.
- **Password**: Renders a securely masked text block for secret API tokens, keys, and database passwords.

For full architectural details, consult the `Code_Guide.md` in the `Design Docs` directory of the MudBringer repository.
