Skip to content

Miscellaneous

endstone.ColorFormat

All supported color and format codes.

Attributes:

Name Type Description
AQUA
BLACK
BLUE
BOLD
DARK_AQUA
DARK_BLUE
DARK_GRAY
DARK_GREEN
DARK_PURPLE
DARK_RED
GOLD
GRAY
GREEN
ITALIC
LIGHT_PURPLE
MATERIAL_AMETHYST
MATERIAL_COPPER
MATERIAL_DIAMOND
MATERIAL_EMERALD
MATERIAL_GOLD
MATERIAL_IRON
MATERIAL_LAPIS
MATERIAL_NETHERITE
MATERIAL_QUARTZ
MATERIAL_REDSTONE
MATERIAL_RESIN
MINECOIN_GOLD
OBFUSCATED
RED
RESET
WHITE
YELLOW

AQUA class-attribute instance-attribute

AQUA = '§b'

BLACK class-attribute instance-attribute

BLACK = '§0'

BLUE class-attribute instance-attribute

BLUE = '§9'

BOLD class-attribute instance-attribute

BOLD = '§l'

DARK_AQUA class-attribute instance-attribute

DARK_AQUA = '§3'

DARK_BLUE class-attribute instance-attribute

DARK_BLUE = '§1'

DARK_GRAY class-attribute instance-attribute

DARK_GRAY = '§8'

DARK_GREEN class-attribute instance-attribute

DARK_GREEN = '§2'

DARK_PURPLE class-attribute instance-attribute

DARK_PURPLE = '§5'

DARK_RED class-attribute instance-attribute

DARK_RED = '§4'

GOLD class-attribute instance-attribute

GOLD = '§6'

GRAY class-attribute instance-attribute

GRAY = '§7'

GREEN class-attribute instance-attribute

GREEN = '§a'

ITALIC class-attribute instance-attribute

ITALIC = '§o'

LIGHT_PURPLE class-attribute instance-attribute

LIGHT_PURPLE = '§d'

MATERIAL_AMETHYST class-attribute instance-attribute

MATERIAL_AMETHYST = '§u'

MATERIAL_COPPER class-attribute instance-attribute

MATERIAL_COPPER = '§n'

MATERIAL_DIAMOND class-attribute instance-attribute

MATERIAL_DIAMOND = '§s'

MATERIAL_EMERALD class-attribute instance-attribute

MATERIAL_EMERALD = '§q'

MATERIAL_GOLD class-attribute instance-attribute

MATERIAL_GOLD = '§p'

MATERIAL_IRON class-attribute instance-attribute

MATERIAL_IRON = '§i'

MATERIAL_LAPIS class-attribute instance-attribute

MATERIAL_LAPIS = '§t'

MATERIAL_NETHERITE class-attribute instance-attribute

MATERIAL_NETHERITE = '§j'

MATERIAL_QUARTZ class-attribute instance-attribute

MATERIAL_QUARTZ = '§h'

MATERIAL_REDSTONE class-attribute instance-attribute

MATERIAL_REDSTONE = '§m'

MATERIAL_RESIN class-attribute instance-attribute

MATERIAL_RESIN = '§v'

MINECOIN_GOLD class-attribute instance-attribute

MINECOIN_GOLD = '§g'

OBFUSCATED class-attribute instance-attribute

OBFUSCATED = '§k'

RED class-attribute instance-attribute

RED = '§c'

RESET class-attribute instance-attribute

RESET = '§r'

WHITE class-attribute instance-attribute

WHITE = '§f'

YELLOW class-attribute instance-attribute

YELLOW = '§e'

endstone.GameMode

Bases: Enum

Represents the various type of game modes that Players may have.

Attributes:

Name Type Description
ADVENTURE
CREATIVE
SPECTATOR
SURVIVAL

ADVENTURE class-attribute instance-attribute

ADVENTURE = 2

CREATIVE class-attribute instance-attribute

CREATIVE = 1

SPECTATOR class-attribute instance-attribute

SPECTATOR = 3

SURVIVAL class-attribute instance-attribute

SURVIVAL = 0

endstone.Logger

Logger class which can format and output varies levels of logs.

Classes:

Name Description
Level

Specifies the log level.

Methods:

Name Description
critical

Log a message at the CRITICAL level.

debug

Log a message at the DEBUG level.

error

Log a message at the ERROR level.

info

Log a message at the INFO level.

is_enabled_for

Check if the Logger instance is enabled for the given log Level.

set_level

Set the logging level for this Logger instance.

trace

Log a message at the TRACE level.

warning

Log a message at the WARNING level.

Attributes:

Name Type Description
CRITICAL
DEBUG
ERROR
INFO
TRACE
WARNING
name str

Get the name of this Logger instance.

CRITICAL class-attribute instance-attribute

CRITICAL = CRITICAL

DEBUG class-attribute instance-attribute

DEBUG = DEBUG

ERROR class-attribute instance-attribute

ERROR = ERROR

INFO class-attribute instance-attribute

INFO = INFO

TRACE class-attribute instance-attribute

TRACE = TRACE

WARNING class-attribute instance-attribute

WARNING = WARNING

name property

name: str

Get the name of this Logger instance.

Level

Bases: IntEnum

Specifies the log level.

Attributes:

Name Type Description
CRITICAL
DEBUG
ERROR
INFO
TRACE
WARNING

CRITICAL class-attribute instance-attribute

CRITICAL = 5

DEBUG class-attribute instance-attribute

DEBUG = 1

ERROR class-attribute instance-attribute

ERROR = 4

INFO class-attribute instance-attribute

INFO = 2

TRACE class-attribute instance-attribute

TRACE = 0

WARNING class-attribute instance-attribute

WARNING = 3

critical

critical(message: str) -> None

Log a message at the CRITICAL level.

debug

debug(message: str) -> None

Log a message at the DEBUG level.

error

error(message: str) -> None

Log a message at the ERROR level.

info

info(message: str) -> None

Log a message at the INFO level.

is_enabled_for

is_enabled_for(level: Level) -> bool

Check if the Logger instance is enabled for the given log Level.

set_level

set_level(level: Level) -> None

Set the logging level for this Logger instance.

trace

trace(message: str) -> None

Log a message at the TRACE level.

warning

warning(message: str) -> None

Log a message at the WARNING level.

endstone.Registry

Bases: Generic[_T]

Presents a registry

Methods:

Name Description
get

Get the object by its key.

get_or_throw

Get the object by its key or throw if missing.

get

get(key: str) -> _T | None

Get the object by its key.

get_or_throw

get_or_throw(key: str) -> _T

Get the object by its key or throw if missing.

endstone.util

Multi and single purpose classes.

Classes:

Name Description
SocketAddress

Represents an IP Socket Address (hostname + port number).

Vector

Represents a 3-dimensional vector.

SocketAddress

SocketAddress()
SocketAddress(hostname: str, port: int)
SocketAddress()

Represents an IP Socket Address (hostname + port number).

Attributes:

Name Type Description
hostname str

Gets the hostname.

port int

Gets the port number.

hostname property

hostname: str

Gets the hostname.

port property

port: int

Gets the port number.

Vector

Vector()
Vector(x: float, y: float, z: float)
Vector()

Represents a 3-dimensional vector.

Methods:

Name Description
angle

Gets the angle between this vector and another in radians.

cross_product

Calculates the cross-product of this vector with another.

distance

The distance between this Vector and another

distance_squared

The squared distance between this Vector and another

dot

Calculates the dot product of this vector with another.

is_in_aabb

Returns whether this vector is in an axis-aligned bounding box.

is_in_sphere

Returns whether this vector is within a sphere.

midpoint

Gets a new midpoint vector between this vector and another.

normalize

Converts this vector to a unit vector (a vector with length of 1).

normalize_zero

Converts each component of value -0.0 to 0.0

rotate_around_axis

Rotates the vector around a given arbitrary axis in 3-dimensional space.

rotate_around_x

Rotates the vector around the x-axis.

rotate_around_y

Rotates the vector around the y-axis.

rotate_around_z

Rotates the vector around the z-axis.

zero

Zero this vector's components.

Attributes:

Name Type Description
block_x int

Gets the floored value of the X component, indicating the block that this vector is contained with.

block_y int

Gets the floored value of the Y component, indicating the block that this vector is contained with.

block_z int

Gets the floored value of the Z component, indicating the block that this vector is contained with.

is_normalized bool

Returns if a vector is normalized.

is_zero bool

Check whether or not each component of this vector is equal to 0.

length float

The magnitude of the Vector

length_squared float

The squared magnitude of the Vector

x float

The X component of the vector

y float

The Y component of the vector

z float

The Z component of the vector

block_x property

block_x: int

Gets the floored value of the X component, indicating the block that this vector is contained with.

block_y property

block_y: int

Gets the floored value of the Y component, indicating the block that this vector is contained with.

block_z property

block_z: int

Gets the floored value of the Z component, indicating the block that this vector is contained with.

is_normalized property

is_normalized: bool

Returns if a vector is normalized.

is_zero property

is_zero: bool

Check whether or not each component of this vector is equal to 0.

length property

length: float

The magnitude of the Vector

length_squared property

length_squared: float

The squared magnitude of the Vector

x property writable

x: float

The X component of the vector

y property writable

y: float

The Y component of the vector

z property writable

z: float

The Z component of the vector

angle

angle(other: Vector) -> float

Gets the angle between this vector and another in radians.

cross_product

cross_product(other: Vector) -> Vector

Calculates the cross-product of this vector with another.

distance

distance(other: Vector) -> float

The distance between this Vector and another

distance_squared

distance_squared(other: Vector) -> float

The squared distance between this Vector and another

dot

dot(other: Vector) -> float

Calculates the dot product of this vector with another.

is_in_aabb

is_in_aabb(min: Vector, max: Vector) -> bool

Returns whether this vector is in an axis-aligned bounding box.

is_in_sphere

is_in_sphere(origin: Vector, radius: float) -> bool

Returns whether this vector is within a sphere.

midpoint

midpoint(other: Vector) -> Vector

Gets a new midpoint vector between this vector and another.

normalize

normalize() -> Vector

Converts this vector to a unit vector (a vector with length of 1).

normalize_zero

normalize_zero() -> Vector

Converts each component of value -0.0 to 0.0

rotate_around_axis

rotate_around_axis(
    axis: Vector, angle: float, normalize: bool = True
) -> Vector

Rotates the vector around a given arbitrary axis in 3-dimensional space.

rotate_around_x

rotate_around_x(angle: float) -> Vector

Rotates the vector around the x-axis.

rotate_around_y

rotate_around_y(angle: float) -> Vector

Rotates the vector around the y-axis.

rotate_around_z

rotate_around_z(angle: float) -> Vector

Rotates the vector around the z-axis.

zero

zero() -> Vector

Zero this vector's components.