border
WorldBorder
¶
WorldBorder(
center: Vector2D,
current_diameter: float,
target_diameter: float,
speed: int,
portal_teleport_boundary: int,
warning_time: int = 15,
warning_blocks: int = 5,
)
Minecraft World Border representation and packet parser.
| ATTRIBUTE | DESCRIPTION |
|---|---|
center |
Center position of the world border
TYPE:
|
current_diameter |
Current diameter of the world border in blocks
TYPE:
|
target_diameter |
Target diameter when lerping/resizing
TYPE:
|
speed |
Time in milliseconds to reach target diameter
TYPE:
|
portal_teleport_boundary |
Portal teleport boundary limit (usually 29999984)
TYPE:
|
warning_time |
Warning time in seconds
TYPE:
|
warning_blocks |
Warning distance in blocks
TYPE:
|
from_coordinates
classmethod
¶
from_coordinates(
center_x: float,
center_z: float,
current_diameter: float,
target_diameter: float,
speed: int,
portal_teleport_boundary: int,
warning_time: int = 15,
warning_blocks: int = 5,
) -> "WorldBorder"
Create WorldBorder from separate x and z coordinates.
| PARAMETER | DESCRIPTION |
|---|---|
center_x
|
X coordinate of border center
TYPE:
|
center_z
|
Z coordinate of border center
TYPE:
|
current_diameter
|
Current diameter of the world border in blocks
TYPE:
|
target_diameter
|
Target diameter when lerping/resizing
TYPE:
|
speed
|
Time in milliseconds to reach target diameter
TYPE:
|
portal_teleport_boundary
|
Portal teleport boundary limit (usually 29999984)
TYPE:
|
warning_time
|
Warning time in seconds (default: 15)
TYPE:
|
warning_blocks
|
Warning distance in blocks (default: 5)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
WorldBorder
|
New WorldBorder instance |
current_radius
¶
current_radius() -> float
Get current radius of the border.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Current radius in blocks |
target_radius
¶
target_radius() -> float
Get target radius of the border.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Target radius in blocks |
is_resizing
¶
is_resizing() -> bool
Check if border is currently resizing.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if current diameter differs from target diameter |
is_shrinking
¶
is_shrinking() -> bool
Check if border is shrinking.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if target diameter is smaller than current diameter |
is_expanding
¶
is_expanding() -> bool
Check if border is expanding.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if target diameter is larger than current diameter |
distance_to_border
¶
distance_to_border_coords
¶
is_inside_border
¶
is_inside_border_coords
¶
is_in_warning_zone
¶
is_in_warning_zone_coords
¶
get_warning_level
¶
get_warning_level_coords
¶
set_center
¶
set_center(center: Vector2D) -> None
Set border center position.
| PARAMETER | DESCRIPTION |
|---|---|
center
|
New center position
TYPE:
|
set_center_coords
¶
set_center_coords(coords: Vector2D) -> None
Set border center position from coordinates.
| PARAMETER | DESCRIPTION |
|---|---|
coords
|
New center position coordinates
TYPE:
|
set_size
¶
set_size(diameter: float) -> None
Set border size immediately.
| PARAMETER | DESCRIPTION |
|---|---|
diameter
|
New diameter in blocks
TYPE:
|