Skip to Content
⚠ Under Construction
ReferencePython APIendstone.plugin

endstone.plugin

Classes:

NameDescription
Plugin
PluginCommandRepresents a Command belonging to a Plugin
PluginDescriptionRepresents the basic information about a plugin that the plugin loader needs to know.
PluginLoadOrderRepresents the order in which a plugin should be initialized and enabled.
PluginLoaderRepresents a plugin loader, which handles direct access to specific types of plugins
PluginManagerRepresents a plugin manager that handles all plugins from the Server
ServiceRepresents a list of methods.
ServiceManagerRepresent a service manager that manages services and service providers.
ServicePriorityRepresents various priorities of a provider.

Plugin

Plugin()

Bases: Plugin

Methods:

Attributes:

api_version

api_version = None

authors

authors = None

commands

commands = None

config

config: dict

contributors

contributors = None

default_permission

default_permission = None

depend

depend = None

description

description = None

load

load = None

load_before

load_before = None

name

name = None

permissions

permissions = None

prefix

prefix = None

provides

provides = None

soft_depend

soft_depend = None

version

version = None

website

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

Bases: Command

Represents a Command belonging to a Plugin

Attributes:

NameTypeDescription
executorCommandExecutorThe CommandExecutor to run when parsing this command
pluginPluginThe owner of this PluginCommand

executor

executor: CommandExecutor

The CommandExecutor to run when parsing this command

plugin

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: list[Permission] | None, **kwargs: list[Permission] | None )

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

Attributes:

NameTypeDescription
api_versionstrGives the API version which this plugin is designed to support.
authorslist[str]Gives the list of authors for the plugin.
commandslist[Command]Gives the list of commands the plugin will register at runtime.
contributorslist[str]Gives the list of contributors for the plugin.
default_permissionPermissionDefaultGives the default value of permissions registered for the plugin.
dependlist[str]Gives a list of other plugins that the plugin requires.
descriptionstrGives a human-friendly description of the functionality the plugin provides.
full_namestrReturns the name of a plugin, including the version.
loadPluginLoadOrderGives the phase of server startup that the plugin should be loaded.
load_beforelist[str]Gets the list of plugins that should consider this plugin a soft-dependency.
namestrGives the name of the plugin. This name is a unique identifier for plugins.
permissionslist[Permission]Gives the list of permissions the plugin will register at runtime, immediately proceeding enabling.
prefixstrGives the token to prefix plugin-specific logging messages with.
provideslist[str]Gives the list of other plugin APIs which this plugin provides. These are usable for other plugins to depend on.
soft_dependlist[str]Gives a list of other plugins that the plugin requires for full functionality.
versionstrGives the version of the plugin.
websitestrGives the plugin’s or plugin’s author’s website.

api_version

api_version: str

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

authors

authors: list[str]

Gives the list of authors for the plugin.

commands

commands: list[Command]

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

contributors

contributors: list[str]

Gives the list of contributors for the plugin.

default_permission

default_permission: PermissionDefault

Gives the default value of permissions registered for the plugin.

depend

depend: list[str]

Gives a list of other plugins that the plugin requires.

description

description: str

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

full_name

full_name: str

Returns the name of a plugin, including the version.

load

load: PluginLoadOrder

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

load_before

load_before: list[str]

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

name

name: str

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

permissions

permissions: list[Permission]

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

prefix

prefix: str

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

provides

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

soft_depend: list[str]

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

version

version: str

Gives the version of the plugin.

website

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:

POSTWORLD

POSTWORLD: PluginLoadOrder

STARTUP

STARTUP: PluginLoadOrder

name

name: str

value

value: int

PluginLoader

PluginLoader(server:Server)

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

Methods:

NameDescription
disable_pluginDisables the specified plugin
enable_pluginEnables the specified plugin
load_pluginLoads the plugin contained in the specified file
load_pluginsLoads the plugin contained within the specified directory

Attributes:

NameTypeDescription
plugin_file_filterslist[str]Returns a list of all filename filters expected by this PluginLoader
serverServerRetrieves the Server object associated with the PluginLoader.

plugin_file_filters

plugin_file_filters: list[str]

Returns a list of all filename filters expected by this PluginLoader

server

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_plugin

load_plugin(file:str) -> Plugin

Loads the plugin contained in the specified file

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:

NameDescription
call_eventCalls an event which will be passed to plugins.
clear_pluginsDisables and removes all plugins
disable_pluginDisables the specified plugin
disable_pluginsDisables all the loaded plugins
enable_pluginEnables the specified plugin
enable_pluginsEnable all the loaded plugins
get_default_perm_subscriptionsGets a set containing all subscribed Permissibles to the given default list, by permission level.
get_default_permissionsGets the default permissions for the given permission level.
get_permissionGets a Permission from its fully qualified name.
get_permission_subscriptionsGets a set containing all subscribed Permissibles to the given permission.
get_pluginChecks if the given plugin is loaded and returns it when applicable.
is_plugin_enabledChecks if the given plugin is enabled or not
load_pluginLoads the plugin in the specified file
load_pluginsLoads the plugin contained within the specified directory
Loads the plugins in the list of the files
recalculate_permission_defaultsRecalculates the defaults for the given Permission.
register_eventRegisters the given event
remove_permissionRemoves a Permission registration from this plugin manager by permission object.
Removes a Permission registration from this plugin manager by name.
subscribe_to_default_permsSubscribes to the given Default permissions by permission level.
subscribe_to_permissionSubscribes the given Permissible for information about the requested Permission.
unsubscribe_from_default_permsUnsubscribes from the given Default permissions by permission level.
unsubscribe_from_permissionUnsubscribes the given Permissible for information about the requested Permission.

Attributes:

NameTypeDescription
permissionsset[Permission]Gets a set of all registered permissions.
pluginslist[Plugin]Gets a list of all currently loaded plugins

permissions

permissions: set[Permission]

Gets a set of all registered permissions.

plugins

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(level:PermissionLevel) -> set[Permissible]

Gets a set containing all subscribed Permissibles to the given default list, by permission level.

get_default_permissions

get_default_permissions(level:PermissionLevel) -> list[Permission]

Gets the default permissions for the given permission level.

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_plugin

load_plugin(file:str) -> Plugin

Loads the plugin in the specified file

load_plugins

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

Loads the plugin contained within the specified directory

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

Loads the plugins in the list of the files

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( level: PermissionLevel, permissible: Permissible ) -> None

Subscribes to the given Default permissions by permission level.

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( level: PermissionLevel, permissible: Permissible ) -> None

Unsubscribes from the given Default permissions by permission level.

unsubscribe_from_permission

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

Unsubscribes the given Permissible for information about the requested Permission.

Service

Service()

Represents a list of methods.

ServiceManager

Represent a service manager that manages services and service providers.

Methods:

NameDescription
load
registerRegister a provider of a service.
unregisterUnregister a particular provider for a particular service.
Unregister a particular provider.
unregister_allUnregister all the services registered by a particular plugin.

load

load(name:str) -> Service

register

register( name: str, provider: Service, plugin: Plugin, priority: ServicePriority ) -> None

Register a provider of a service.

unregister

unregister(name:str, provider:Service) -> None

Unregister a particular provider for a particular service.

unregister(provider:Service) -> None

Unregister a particular provider.

unregister_all

unregister_all(plugin:Plugin) -> None

Unregister all the services registered by a particular plugin.

ServicePriority

ServicePriority(value:int)

Represents various priorities of a provider.

Attributes:

HIGH

HIGH: ServicePriority

HIGHEST

HIGHEST: ServicePriority

LOW

LOW: ServicePriority

LOWEST

LOWEST: ServicePriority

NORMAL

NORMAL: ServicePriority

name

name: str

value

value: int
Last updated on