Skip to content

PluginBase

abstract class

Base class for all .NET Endstone plugins.

Namespace Endstone.Loader

Inheritance Plugin › object

Constructors

  • PluginBase()

Properties

Logger : Logger

{ get; }

Scheduler : Scheduler

{ get; }

Server : Server

{ get; }

ServiceManager : ServiceManager

{ get; }

Methods

CommandBuilder Command(string name)

Declares a plugin command (registered when the plugin is loaded). Fluent chain: Command("hello").Description(...).Usage(...).Alias(...).Permission(...).Handler(handler).

void OnDisable()

void OnEnable()

void OnLoad()

Permission Permission(string name)

Creates a new permission owned by this plugin. Permissions created through this factory are registered automatically when the plugin is loaded (before OnLoad), mirroring the Python plugin's permissions declaration. Configure it with the fluent With... methods, e.g. Permission("myplugin.kit").WithDefault(PermissionDefault.True). After registration the wrapper stays usable as a non-owning view of the registered permission; keep it in a plugin field to keep modifying it. Use new Permission(...) + Register() for permissions created at runtime.

void RegisterEvent(System.Action<T> handler, EventPriority priority, bool ignoreCancelled)

void RegisterEvent(string eventName, System.Action<Event> handler, EventPriority priority, bool ignoreCancelled)

Registers an event handler for the given Endstone event name.