Miscellaneous
endstone.ColorFormat
¶
All supported color and format codes.
Attributes:
endstone.GameMode
¶
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 |
debug |
Log a message at the |
error |
Log a message at the |
info |
Log a message at the |
is_enabled_for |
Check if the |
set_level |
Set the logging level for this |
trace |
Log a message at the |
warning |
Log a message at the |
Attributes:
| Name | Type | Description |
|---|---|---|
CRITICAL |
|
|
DEBUG |
|
|
ERROR |
|
|
INFO |
|
|
TRACE |
|
|
WARNING |
|
|
name |
str
|
The name of this |
Level
¶
is_enabled_for
¶
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. |
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
¶
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 without mutating the original. |
distance |
Get the distance between this vector and another. |
distance_squared |
Get 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 |
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
|
The floored value of the X component, indicating the block that this vector is contained with. |
block_y |
int
|
The floored value of the Y component, indicating the block that this vector is contained with. |
block_z |
int
|
The floored value of the Z component, indicating the block that this vector is contained with. |
is_normalized |
bool
|
|
is_zero |
bool
|
|
length |
float
|
The magnitude of the vector, defined as sqrt(x^2 + y^2 + z^2). |
length_squared |
float
|
The magnitude of the vector squared. |
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
The floored value of the X component, indicating the block that this vector is contained with.
block_y
property
¶
block_y: int
The floored value of the Y component, indicating the block that this vector is contained with.
block_z
property
¶
block_z: int
The floored value of the Z component, indicating the block that this vector is contained with.
angle
¶
cross_product
¶
distance
¶
distance_squared
¶
dot
¶
is_in_aabb
¶
Returns whether this vector is in an axis-aligned bounding box.
The minimum and maximum vectors given must be truly the minimum and maximum X, Y and Z components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min
|
Vector
|
Minimum vector. |
required |
max
|
Vector
|
Maximum vector. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether this vector is in the |
is_in_sphere
¶
midpoint
¶
normalize
¶
normalize() -> Vector
Converts this vector to a unit vector (a vector with length of 1).
rotate_around_axis
¶
Rotates the vector around a given arbitrary axis in 3-dimensional space.
Rotation will follow the general Right-Hand-Rule, which means rotation will be counterclockwise when the axis is pointing towards the observer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axis
|
Vector
|
The axis to rotate the vector around. |
required |
angle
|
float
|
The angle to rotate the vector around the axis. |
required |
normalize
|
bool
|
When |
True
|
rotate_around_x
¶
Rotates the vector around the x-axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angle
|
float
|
The angle to rotate the vector about, in radians. |
required |
rotate_around_y
¶
Rotates the vector around the y-axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angle
|
float
|
The angle to rotate the vector about, in radians. |
required |