Skip to content

Command

endstone.command

Command

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

aliases property writable

aliases: list[str]

List of aliases of this command

description property writable

description: str

Brief description of this command

name property writable

name: str

Name of this command.

permissions property writable

permissions: list[str]

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

registered property

registered: bool

Returns the current registered state of this command

usages property writable

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

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.

name property

name: str

Gets the name of this command sender

server property

server: Server

Returns the server instance that this command is running on

as_player

as_player() -> Player

Cast to a Player instance

send_error_message

send_error_message(message: str) -> None

Sends this sender an error message

send_error_message(message: Translatable) -> None

Sends this sender a translatable error message

send_message

send_message(message: str) -> None

Sends this sender a message

send_message(message: Translatable) -> None

Sends this sender a translatable message