Plugin services
Plugin services are the interfaces plugins use to interact with the game. Get a service in your plugin with PluginServiceProvider.GetService<T>(), for example:
public static readonly IItemComponentRegistrar ItemComponentRegistrar =
PluginServiceProvider.GetService<IItemComponentRegistrar>();
This documentation is generated from the documentation comments in the game’s code.
| Service | Description |
|---|---|
| IBarotraumaPlugin | The main entry point for a Barotrauma plugin. The interface implements IDisposable to allow for cleanup when the plugin is unloaded. |
| IAIObjectiveRegistrar | Allows plugins to configure what AIObjective is created for an order identifier. |
| IContentFileRegistrar | Interface that allows registering custom XML content in your mod. |
| IContentPackageRetrievalService | Provides a way for plugins to get their own Content Package and check for dependencies. |
| IDebugConsole | Provides an interface to DebugConsole for plugins. Allows registering commands and writing messages to F3 debug console. |
| IEventActionRegistrar | Provides methods for registering custom event actions to be loaded in ScriptedEvent. |
| IGameNetwork | Provides a service to allow client and server side network communication in multiplayer. |
| IGameScreen | Provides a service to add events that trigger on resolution change. |
| IHarmonyProvider | Provides a HarmonyX instance that plugins can use to patch game methods at runtime, i.e. run their own code before (prefix), after (postfix) or instead of existing methods. |
| IItemComponentRegistrar | Provides methods for registering custom implementations of ItemComponent that can be added to items. |
| ISettingsService | Allows plugins to create their own settings that can be saved to disk, edited in game and networked. |
| ISimpleHookService | Allows plugins to register callback functions that get called at specific points in the game. |
| IStatusEffectService | Allows plugins to register custom status effect actions. |
| Hooks | Hooks are callbacks that get called at specific points in the game. Register one with ISimpleHookService’s RegisterHook<T>(), where T is one of the delegate types listed here. |