> For the complete documentation index, see [llms.txt](https://docs.hogwarp.com/hogwarp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hogwarp.com/hogwarp/scripting/server-side/plugin/plugin-plugin.md).

# Plugin ↔ Plugin

Given that there are two plugins `PluginA` and `PluginB` , it is possible to call methods / access each other using the **PluginManager**.

A reference to the build `*.dll` of the other plugin is required in the solution, similiar to the `HogWarpSdk.dll` reference done in [Creating a Plugin](/hogwarp/scripting/server-side/plugin/creating-a-plugin.md#configure-the-project).

{% hint style="info" %}
Make sure to only access another plugin earliest in the `PostLoad` lifecycle, as it is not guaranteed to be loaded if called earlier.
{% endhint %}

## Example

{% code title="PluginA.cs" lineNumbers="true" %}

```csharp
namespace PluginA;

public class Plugin : HogWarpSdk.IPlugin
{
    public string Author { get; } = "YourName";
    public string Name { get; } = "PluginA";
    public Version Version { get; } = new(1, 0, 0, 0);
    
    public Plugin() { }

    public void PostLoad() { }

    public void Shutdown() { }
    
    public void DoSomething() 
    {
        // This method is called from a different plugin
    }
}
```

{% endcode %}

{% code title="PluginB.cs" overflow="wrap" %}

```csharp
namespace PluginB;

public class Plugin : HogWarpSdk.IPlugin
{
    public string Author { get; } = "YourName";
    public string Name { get; } = "PluginB";
    public Version Version { get; } = new(1, 0, 0, 0);
    
    public Plugin() { }

    public void PostLoad() 
    { 
        _logger.Info("Post load");

        var pluginA = HogWarpSdk.Server.PluginManager.Get<PluginA.Plugin>();
        if (pluginA != null)
        {
            _logger.Info($"PluginA found, version {pluginA.Version}");
            pluginA.DoSomething();
        }
        else
        {
            _logger.Info("PluginA not found");
        }
    }

    public void Shutdown() { }
}
```

{% endcode %}
