endstone.command

Classes relating to handling specialized non-chat player input.

Classes relating to handling specialized non-chat player input.

Classes

NameDescription
BlockCommandSender

Represents a block command sender.

Command

Represents a Command, which executes various tasks upon user input

CommandExecutor

Represents a class which contains a single method for executing commands

CommandSender

Represents a command sender.

CommandSenderWrapper

Represents a wrapper that forwards commands to the wrapped CommandSender and captures its output

ConsoleCommandSender

Represents a console command sender.

classBlockCommandSender

Bases: CommandSender

BlockCommandSender()

Represents a block command sender.

Attributes

NameTypeDescription
blockBlock

Returns the block this command sender belongs to

attrblockproperty

block: Block

Returns the block this command sender belongs to

classCommand

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

Represents a Command, which executes various tasks upon user input

Methods

NameDescription
execute

Executes the command, returning its success

test_permission

Tests the given CommandSender to see if they can perform this command.

test_permission_silently

Tests the given CommandSender to see if they can perform this command. No error is sent to the sender.

Attributes

NameTypeDescription
aliaseslist[str]

List of aliases of this command

descriptionstr

Brief description of this command

is_registeredbool

Returns the current registered state of this command

namestr

Name of this command.

permissionslist[str]

The permissions required by users to be able to perform this command

usageslist[str]

List of usages of this command

attraliasesproperty

aliases: list[str]

List of aliases of this command

attrdescriptionproperty

description: str

Brief description of this command

attris_registeredproperty

is_registered: bool

Returns the current registered state of this command

attrnameproperty

name: str

Name of this command.

attrpermissionsproperty

permissions: list[str]

The permissions required by users to be able to perform this command

attrusagesproperty

usages: list[str]

List of usages of this command

methexecute

execute(sender: CommandSender, args: list[str]) -> bool

Executes the command, returning its success

methtest_permission

test_permission(target: CommandSender) -> bool

Tests the given CommandSender to see if they can perform this command.

methtest_permission_silently

test_permission_silently(target: CommandSender) -> bool

Tests the given CommandSender to see if they can perform this command. No error is sent to the sender.

classCommandExecutor

CommandExecutor()

Represents a class which contains a single method for executing commands

Methods

NameDescription
on_command

Executes the given command, returning its success.

methon_command

on_command(sender: CommandSender, command: Command, args: list[str]) -> bool

Executes the given command, returning its success.

classCommandSender

Bases: Permissible

CommandSender()

Represents a command sender.

Methods

NameDescription
send_error_message

Sends this sender an error message

send_message

Sends this sender a message

Attributes

NameTypeDescription
namestr

Gets the name of this command sender

serverServer

Returns the server instance that this command is running on

attrnameproperty

name: str

Gets the name of this command sender

attrserverproperty

server: Server

Returns the server instance that this command is running on

methsend_error_message

send_error_message(message: str | Translatable) -> None

Sends this sender an error message

methsend_message

send_message(message: str | Translatable) -> None

Sends this sender a message

classCommandSenderWrapper

Bases: CommandSender

CommandSenderWrapper(sender: CommandSender, on_message: Callable[[str | Translatable], None] = None, on_error: Callable[[str | Translatable], None] = None)

Represents a wrapper that forwards commands to the wrapped CommandSender and captures its output

classConsoleCommandSender

Bases: CommandSender

ConsoleCommandSender()

Represents a console command sender.

On this page