Skip to content

PluginMetadata

Namespace Mc.Scripting · Kind class (sealed)

public sealed class PluginMetadata

What a plugin declares about itself: from plugin.json, or from PluginInfoAttribute when there is no manifest.

Member Description
PluginMetadata(string id, string name, string version) Creates metadata (the runtime does this; plugins read it from PluginContext.Info).
public PluginMetadata(string id, string name, string version)

Creates metadata (the runtime does this; plugins read it from PluginContext.Info).

Parameters

Name Type Description
id string
name string
version string
Member Description
ApiVersion Api { get; init; } The plugin API version the plugin was written for.
bool ApiDeclared { get; init; } Whether the manifest named an API version (otherwise 1.0 was assumed).
IReadOnlyList<string> Authors { get; init; } The author names.
IReadOnlyList<PluginDependency> Depends { get; init; } Plugins that must be loaded (and enabled) before this one; a missing one prevents this plugin from loading.
string Description { get; init; } A one-line description.
string Id { get; } Unique id: lower case letters, digits, ‘-’ and ‘_’ (1-32 characters).
IReadOnlyList<string> LoadBefore { get; init; } Plugins that should be loaded after this one (the reverse of a soft dependency).
string? Main { get; init; } The full name of the plugin class when the assembly has several candidates (default: the single public IPlugin).
string Name { get; } Display name (used as the log prefix).
IReadOnlyList<PluginDependency> SoftDepends { get; init; } Plugins that are loaded before this one when present.
string Source { get; init; } The path of the manifest or assembly this was read from.
string Version { get; } Plugin version.
string Website { get; init; } A website or repository url.
public ApiVersion Api { get; init; }

The plugin API version the plugin was written for.

public bool ApiDeclared { get; init; }

Whether the manifest named an API version (otherwise 1.0 was assumed).

public IReadOnlyList<string> Authors { get; init; }

The author names.

public IReadOnlyList<PluginDependency> Depends { get; init; }

Plugins that must be loaded (and enabled) before this one; a missing one prevents this plugin from loading.

public string Description { get; init; }

A one-line description.

public string Id { get; }

Unique id: lower case letters, digits, ‘-’ and ‘_’ (1-32 characters). Also the data folder name.

public IReadOnlyList<string> LoadBefore { get; init; }

Plugins that should be loaded after this one (the reverse of a soft dependency).

public string? Main { get; init; }

The full name of the plugin class when the assembly has several candidates (default: the single public IPlugin).

public string Name { get; }

Display name (used as the log prefix).

public IReadOnlyList<PluginDependency> SoftDepends { get; init; }

Plugins that are loaded before this one when present.

public string Source { get; init; }

The path of the manifest or assembly this was read from.

public string Version { get; }

Plugin version.

public string Website { get; init; }

A website or repository url.

Member Description
static bool IsValidId(string id) Whether id is a valid plugin id.
public static bool IsValidId(string id)

Whether id is a valid plugin id.

Parameters

Name Type Description
id string The text.

Returns bool

ApiVersion · PluginDependency