> 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/structure-lifecycle.md).

# Structure / Lifecycle

{% hint style="info" %}
All plugins **must** implement the `HogwarpSdk.IPlugin` interface.
{% endhint %}

1. Upon start of the server, the server will invoke the constructor of all existing classes that implement the [IPlugin](/hogwarp/scripting/server-side/api-documentation/server/iplugin.md) interface
2. &#x20;After **all** plugins have been loaded, their `PostLoad` method will be called.
3. If the server is shutdown (gracefully), the `Shutdown` method of each plugin is called.

{% hint style="warning" %}
The `Shutdown` method may be skipped, in case the server process is killed, so it cannot be guaranteed to be executed correctly.
{% endhint %}

Additionally, the fields `Author`, `Name`and `Version`are required

## Example

```csharp
public class Plugin : HogWarpSdk.IPlugin
{
    public string Author { get; } = "";
    public string Name { get; } = "";
    public Version Version { get; } = new(1, 0, 0, 0);
    
    public Plugin()
    {
        // Called first, when server starts
    }

    public void PostLoad()
    {
        // Called after all plugins have been loaded
    }

    public void Shutdown()
    {
        // Called when plugin / server gets shutdown
    }
}


```
