Skip to content

Plugin

endstone.plugin

Modules:

Name Description
endstone_python

Classes:

Name Description
Plugin
PluginCommand

Represents a Command belonging to a Plugin

PluginDescription

Represents the basic information about a plugin that the plugin loader needs to know.

PluginLoadOrder

Represents the order in which a plugin should be initialized and enabled.

PluginLoader

Represents a plugin loader, which handles direct access to specific types of plugins

PluginManager

Represents a plugin manager that handles all plugins from the Server

Plugin

Plugin()

Bases: Plugin

Methods:

Name Description
register_events
reload_config
save_config
save_default_config
save_resources

Attributes:

Name Type Description
api_version
authors
commands
config dict
contributors
default_permission
depend
description
load
load_before
name
permissions
prefix
provides
soft_depend
version
website

api_version class-attribute instance-attribute

api_version = None

authors class-attribute instance-attribute

authors = None

commands class-attribute instance-attribute

commands = None

config property

config: dict

contributors class-attribute instance-attribute

contributors = None

default_permission class-attribute instance-attribute

default_permission = None

depend class-attribute instance-attribute

depend = None

description class-attribute instance-attribute

description = None

load class-attribute instance-attribute

load = None

load_before class-attribute instance-attribute

load_before = None

name class-attribute instance-attribute

name = None

permissions class-attribute instance-attribute

permissions = None

prefix class-attribute instance-attribute

prefix = None

provides class-attribute instance-attribute

provides = None

soft_depend class-attribute instance-attribute

soft_depend = None

version class-attribute instance-attribute

version = None

website class-attribute instance-attribute

website = None

register_events

register_events(listener: object) -> None

reload_config

reload_config() -> dict

save_config

save_config() -> None

save_default_config

save_default_config() -> None

save_resources

save_resources(path: str, replace: bool = False) -> None

PluginCommand

PluginCommand(
    name: str,
    description: str | None = None,
    usages: list[str] | None = None,
    aliases: list[str] | None = None,
    permissions: list[str] | None = None,
    *args,
    **kwargs
)

Bases: Command

Represents a Command belonging to a Plugin

Attributes:

Name Type Description
executor CommandExecutor

The CommandExecutor to run when parsing this command

plugin Plugin

The owner of this PluginCommand

executor property writable

executor: CommandExecutor

The CommandExecutor to run when parsing this command

plugin property

plugin: Plugin

The owner of this PluginCommand

PluginDescription

PluginDescription(
    name: str,
    version: str,
    description: str | None = None,
    load: PluginLoadOrder | None = None,
    authors: list[str] | None = None,
    contributors: list[str] | None = None,
    website: str | None = None,
    prefix: str | None = None,
    provides: list[str] | None = None,
    depend: list[str] | None = None,
    soft_depend: list[str] | None = None,
    load_before: list[str] | None = None,
    default_permission: PermissionDefault | None = None,
    commands: list[Command] | None = None,
    permissions: list[Permission] | None = None,
    *args,
    **kwargs
)

Represents the basic information about a plugin that the plugin loader needs to know.

Attributes:

Name Type Description
api_version str

Gives the API version which this plugin is designed to support.

authors list[str]

Gives the list of authors for the plugin.

commands list[Command]

Gives the list of commands the plugin will register at runtime.

contributors list[str]

Gives the list of contributors for the plugin.

default_permission PermissionDefault

Gives the default value of permissions registered for the plugin.

depend list[str]

Gives a list of other plugins that the plugin requires.

description str

Gives a human-friendly description of the functionality the plugin provides.

full_name str

Returns the name of a plugin, including the version.

load PluginLoadOrder

Gives the phase of server startup that the plugin should be loaded.

load_before list[str]

Gets the list of plugins that should consider this plugin a soft-dependency.

name str

Gives the name of the plugin. This name is a unique identifier for plugins.

permissions list[Permission]

Gives the list of permissions the plugin will register at runtime, immediately proceeding enabling.

prefix str

Gives the token to prefix plugin-specific logging messages with.

provides list[str]

Gives the list of other plugin APIs which this plugin provides. These are usable for other plugins to depend on.

soft_depend list[str]

Gives a list of other plugins that the plugin requires for full functionality.

version str

Gives the version of the plugin.

website str

Gives the plugin's or plugin's author's website.

api_version property

api_version: str

Gives the API version which this plugin is designed to support.

authors property

authors: list[str]

Gives the list of authors for the plugin.

commands property

commands: list[Command]

Gives the list of commands the plugin will register at runtime.

contributors property

contributors: list[str]

Gives the list of contributors for the plugin.

default_permission property

default_permission: PermissionDefault

Gives the default value of permissions registered for the plugin.

depend property

depend: list[str]

Gives a list of other plugins that the plugin requires.

description property

description: str

Gives a human-friendly description of the functionality the plugin provides.

full_name property

full_name: str

Returns the name of a plugin, including the version.

load property

Gives the phase of server startup that the plugin should be loaded.

load_before property

load_before: list[str]

Gets the list of plugins that should consider this plugin a soft-dependency.

name property

name: str

Gives the name of the plugin. This name is a unique identifier for plugins.

permissions property

permissions: list[Permission]

Gives the list of permissions the plugin will register at runtime, immediately proceeding enabling.

prefix property

prefix: str

Gives the token to prefix plugin-specific logging messages with.

provides property

provides: list[str]

Gives the list of other plugin APIs which this plugin provides. These are usable for other plugins to depend on.

soft_depend property

soft_depend: list[str]

Gives a list of other plugins that the plugin requires for full functionality.

version property

version: str

Gives the version of the plugin.

website property

website: str

Gives the plugin's or plugin's author's website.

PluginLoadOrder

PluginLoadOrder(value: int)

Represents the order in which a plugin should be initialized and enabled.

Attributes:

Name Type Description
POSTWORLD PluginLoadOrder
STARTUP PluginLoadOrder
name str
value int

POSTWORLD class-attribute

POSTWORLD: PluginLoadOrder

STARTUP class-attribute

STARTUP: PluginLoadOrder

name property

name: str

value property

value: int

PluginLoader

PluginLoader(server: Server)

Represents a plugin loader, which handles direct access to specific types of plugins

Methods:

Name Description
disable_plugin

Disables the specified plugin

enable_plugin

Enables the specified plugin

load_plugins

Loads the plugin contained within the specified directory

Attributes:

Name Type Description
server Server

Retrieves the Server object associated with the PluginLoader.

server property

server: Server

Retrieves the Server object associated with the PluginLoader.

disable_plugin

disable_plugin(plugin: Plugin) -> None

Disables the specified plugin

enable_plugin

enable_plugin(plugin: Plugin) -> None

Enables the specified plugin

load_plugins

load_plugins(directory: str) -> list[Plugin]

Loads the plugin contained within the specified directory

PluginManager

Represents a plugin manager that handles all plugins from the Server

Methods:

Name Description
call_event

Calls an event which will be passed to plugins.

clear_plugins

Disables and removes all plugins

disable_plugin

Disables the specified plugin

disable_plugins

Disables all the loaded plugins

enable_plugin

Enables the specified plugin

enable_plugins

Enable all the loaded plugins

get_default_perm_subscriptions

Gets a set containing all subscribed Permissibles to the given default list, by op status.

get_default_permissions

Gets the default permissions for the given op status.

get_permission

Gets a Permission from its fully qualified name.

get_permission_subscriptions

Gets a set containing all subscribed Permissibles to the given permission.

get_plugin

Checks if the given plugin is loaded and returns it when applicable.

is_plugin_enabled
load_plugins

Loads the plugin contained within the specified directory

recalculate_permission_defaults

Recalculates the defaults for the given Permission.

register_event

Registers the given event

remove_permission
subscribe_to_default_perms

Subscribes to the given Default permissions by operator status.

subscribe_to_permission

Subscribes the given Permissible for information about the requested Permission.

unsubscribe_from_default_perms

Unsubscribes from the given Default permissions by operator status.

unsubscribe_from_permission

Unsubscribes the given Permissible for information about the requested Permission.

Attributes:

Name Type Description
permissions set[Permission]

Gets a set of all registered permissions.

plugins list[Plugin]

Gets a list of all currently loaded plugins

permissions property

permissions: set[Permission]

Gets a set of all registered permissions.

plugins property

plugins: list[Plugin]

Gets a list of all currently loaded plugins

call_event

call_event(event: Event) -> None

Calls an event which will be passed to plugins.

clear_plugins

clear_plugins() -> None

Disables and removes all plugins

disable_plugin

disable_plugin(plugin: Plugin) -> None

Disables the specified plugin

disable_plugins

disable_plugins() -> None

Disables all the loaded plugins

enable_plugin

enable_plugin(plugin: Plugin) -> None

Enables the specified plugin

enable_plugins

enable_plugins() -> None

Enable all the loaded plugins

get_default_perm_subscriptions

get_default_perm_subscriptions(
    op: bool,
) -> set[Permissible]

Gets a set containing all subscribed Permissibles to the given default list, by op status.

get_default_permissions

get_default_permissions(op: bool) -> set[Permission]

Gets the default permissions for the given op status.

get_permission

get_permission(name: str) -> Permission

Gets a Permission from its fully qualified name.

get_permission_subscriptions

get_permission_subscriptions(
    permission: str,
) -> set[Permissible]

Gets a set containing all subscribed Permissibles to the given permission.

get_plugin

get_plugin(name: str) -> Plugin

Checks if the given plugin is loaded and returns it when applicable.

is_plugin_enabled

is_plugin_enabled(plugin: str) -> bool

Checks if the given plugin is enabled or not

is_plugin_enabled(plugin: Plugin) -> bool

Checks if the given plugin is enabled or not

load_plugins

load_plugins(directory: str) -> list[Plugin]

Loads the plugin contained within the specified directory

recalculate_permission_defaults

recalculate_permission_defaults(perm: Permission) -> None

Recalculates the defaults for the given Permission.

register_event

register_event(
    name: str,
    executor: Callable[[Event], None],
    priority: EventPriority,
    plugin: Plugin,
    ignore_cancelled: bool,
) -> None

Registers the given event

remove_permission

remove_permission(perm: Permission) -> None

Removes a Permission registration from this plugin manager by permission object.

remove_permission(name: str) -> None

Removes a Permission registration from this plugin manager by name.

subscribe_to_default_perms

subscribe_to_default_perms(
    op: bool, permissible: Permissible
) -> None

Subscribes to the given Default permissions by operator status.

subscribe_to_permission

subscribe_to_permission(
    permission: str, permissible: Permissible
) -> None

Subscribes the given Permissible for information about the requested Permission.

unsubscribe_from_default_perms

unsubscribe_from_default_perms(
    op: bool, permissible: Permissible
) -> None

Unsubscribes from the given Default permissions by operator status.

unsubscribe_from_permission

unsubscribe_from_permission(
    permission: str, permissible: Permissible
) -> None

Unsubscribes the given Permissible for information about the requested Permission.