Skip to Content
⚠ Under Construction
ReferencePython APIendstone.command

endstone.command

Classes:

NameDescription
BlockCommandSenderRepresents a block command sender.
CommandRepresents a Command, which executes various tasks upon user input
CommandExecutorRepresents a class which contains a single method for executing commands
CommandSenderRepresents a command sender.
CommandSenderWrapperRepresents a wrapper that forwards commands to the wrapped CommandSender and captures its output
ConsoleCommandSenderRepresents a console command sender.

BlockCommandSender

Bases: CommandSender

Represents a block command sender.

Attributes:

NameTypeDescription
blockBlockReturns the block this command sender belongs to

block

block: Block

Returns the block this command sender belongs to

Command

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

Represents a Command, which executes various tasks upon user input

Methods:

NameDescription
executeExecutes the command, returning its success
test_permissionTests the given CommandSender to see if they can perform this command.
test_permission_silentlyTests 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
descriptionstrBrief description of this command
is_registeredboolReturns the current registered state of this command
namestrName 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

aliases

aliases: list[str]

List of aliases of this command

description

description: str

Brief description of this command

is_registered

is_registered: bool

Returns the current registered state of this command

name

name: str

Name of this command.

permissions

permissions: list[str]

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

usages

usages: list[str]

List of usages of this command

execute

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

Executes the command, returning its success

test_permission

test_permission(target:CommandSender) -> bool

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

test_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.

CommandExecutor

CommandExecutor()

Represents a class which contains a single method for executing commands

Methods:

NameDescription
on_commandExecutes the given command, returning its success.

on_command

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

Executes the given command, returning its success.

CommandSender

Bases: Permissible

Represents a command sender.

Methods:

NameDescription
send_error_messageSends this sender an error message
send_messageSends this sender a message

Attributes:

NameTypeDescription
namestrGets the name of this command sender
serverServerReturns the server instance that this command is running on

name

name: str

Gets the name of this command sender

server

server: Server

Returns the server instance that this command is running on

send_error_message

send_error_message(message:str | Translatable) -> None

Sends this sender an error message

send_message

send_message(message:str | Translatable) -> None

Sends this sender a message

CommandSenderWrapper

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

Bases: CommandSender

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

ConsoleCommandSender

Bases: CommandSender

Represents a console command sender.

Last updated on