Overview
IDalamudPluginInterface is your plugin’s main gateway to Dalamud functionality. It’s automatically injected into your plugin’s constructor and provides access to:
- UI building and drawing
- Configuration management
- Plugin metadata and state
- Inter-plugin communication (IPC)
- Service creation and injection
- Dalamud system information
Basic Usage
Receive the interface via constructor injection:Properties
Plugin Information
The current internal plugin name.See IDalamudPluginInterface.cs:70
The plugin’s manifest containing all metadata.See IDalamudPluginInterface.cs:76
The reason this plugin was loaded.Possible values (see PluginLoadReason.cs:8-33):
Unknown: Unknown reasonInstaller: Installed via plugin installerUpdate: Just updatedReload: Developer reloadBoot: Game started or Dalamud reinjected
Whether this is a dev plugin.See IDalamudPluginInterface.cs:81
Whether this is a testing release of a plugin.See IDalamudPluginInterface.cs:89
The repository from which this plugin was installed.Official plugins return See IDalamudPluginInterface.cs:66
SpecialPluginSource.MainRepo.
Dev plugins return SpecialPluginSource.DevPlugin.Timing Information
The local time when this plugin was loaded.See IDalamudPluginInterface.cs:94
The UTC time when this plugin was loaded.See IDalamudPluginInterface.cs:99
The time elapsed since this plugin was loaded.See IDalamudPluginInterface.cs:104
Directories and Files
The directory where Dalamud assets are stored.See IDalamudPluginInterface.cs:109
The location of your plugin assembly.See IDalamudPluginInterface.cs:114
The directory where your plugin configurations are stored.See IDalamudPluginInterface.cs:119
The default config file for your plugin.See IDalamudPluginInterface.cs:124
UI and System State
The UI builder instance for drawing ImGui interfaces.See IDalamudPluginInterface.cs:129 and UiBuilder.cs:28-335
Whether Dalamud is running in Debug mode or the See IDalamudPluginInterface.cs:134
/xldev menu is open.Whether a debugger is attached.See IDalamudPluginInterface.cs:139
The current UI language in two-letter ISO format.See IDalamudPluginInterface.cs:144
Whether auto-updates have completed this session.See IDalamudPluginInterface.cs:57
Utilities
Serializer class with functions to remove special characters from strings.See IDalamudPluginInterface.cs:149
The chat type used by default for plugin messages.See IDalamudPluginInterface.cs:154
A list of installed plugins along with their current state.See IDalamudPluginInterface.cs:159
Events
Event fired when the UI language changes.See IDalamudPluginInterface.cs:42
Event fired when the active list of plugins changes.See IDalamudPluginInterface.cs:47
Configuration Methods
Save a plugin configuration that inherits See IDalamudPluginInterface.cs:284
IPluginConfiguration.Get a previously saved plugin configuration or null if none exists.See IDalamudPluginInterface.cs:290
Get the config directory path.See IDalamudPluginInterface.cs:296
Get the localization directory path.See IDalamudPluginInterface.cs:302
UI Integration
Opens the plugin installer window.See IDalamudPluginInterface.cs:167
Opens the Dalamud settings window.See IDalamudPluginInterface.cs:175
Opens the dev menu bar.See IDalamudPluginInterface.cs:181
Plugin Queries
Gets information about which plugin an assembly or load context belongs to.See IDalamudPluginInterface.cs:188, 195
Gets information about the version of Dalamud this plugin is loaded into.See IDalamudPluginInterface.cs:201
Data Sharing
Share data between plugins using tag-based storage:Gets existing data or creates it if it doesn’t exist.See IDalamudPluginInterface.cs:204
Tries to get existing data.See IDalamudPluginInterface.cs:210
Gets existing data or null.See IDalamudPluginInterface.cs:213
Releases shared data.See IDalamudPluginInterface.cs:207
Inter-Plugin Communication (IPC)
See the IPC guide for detailed information.Provider Methods
Create IPC providers to expose functionality:GetIpcProvider<TRet>(name)GetIpcProvider<T1, TRet>(name)GetIpcProvider<T1, T2, TRet>(name)- … up to 8 type parameters
Subscriber Methods
Subscribe to other plugins’ IPC:GetIpcSubscriber<TRet>(name)GetIpcSubscriber<T1, TRet>(name)GetIpcSubscriber<T1, T2, TRet>(name)- … up to 8 type parameters
Dependency Injection
Create and inject instances with dependencies:Create a new object with dependency injection.See IDalamudPluginInterface.cs:310
Asynchronously create a new object with dependency injection.See IDalamudPluginInterface.cs:318
Inject services into an existing object’s properties.See IDalamudPluginInterface.cs:326
Asynchronously inject services into an existing object.See IDalamudPluginInterface.cs:334
Complete Example
Here’s a comprehensive example using many interface features:Plugin.cs
Best Practices
Always Unsubscribe
Always unsubscribe from events in
Dispose(). Failing to do so causes memory leaks.Check for Nulls
Some properties may be null. Always check before using them.
Use IPC Carefully
IPC calls can throw exceptions if the other plugin isn’t loaded. Wrap in try-catch.
Respect Load Reason
Use
Reason to adjust behavior. Don’t show welcome messages on every reload.Next Steps
UI Builder
Learn how to create rich user interfaces with ImGui
IPC Overview
Master inter-plugin communication
Services
Explore all available Dalamud services
Debugging
Learn how to debug your plugin effectively