Skip to content

Server

endstone.Server

Represents a server implementation.

Methods:

Name Description
broadcast

Broadcasts the specified message to every user with the given permission name.

broadcast_message

Broadcasts the specified message to every user with permission endstone.broadcast.user

create_block_data

Creates a new BlockData instance for the specified block type, with all properties initialized to defaults, except for those provided.

create_boss_bar

Creates a boss bar instance to display to players. The progress defaults to 1.0.

create_scoreboard

Creates a new Scoreboard to be tracked by the server.

dispatch_command

Dispatches a command on this server, and executes it if found.

get_player
get_plugin_command

Gets a PluginCommand with the given name or alias.

reload

Reloads the server configuration, functions, scripts and plugins.

reload_data

Reload only the Minecraft data for the server.

shutdown

Shutdowns the server, stopping everything.

Attributes:

Name Type Description
average_mspt float

Gets the average milliseconds per tick (MSPT).

average_tick_usage float

Gets the average tick usage of the server.

average_tps float

Gets the average ticks per second (TPS).

command_sender ConsoleCommandSender

Gets a CommandSender for this server.

current_mspt float

Gets the current milliseconds per tick (MSPT).

current_tick_usage float

Gets the current tick usage of the server.

current_tps float

Gets the current ticks per second (TPS).

language Language

Gets the current language interface used by the server.

level Level

Gets the server level.

logger Logger

Returns the primary logger associated with this server instance.

max_players int

The maximum amount of players which can login to this server.

minecraft_version str

Gets the Minecraft version that this server is running.

name str

Gets the name of this server implementation.

online_mode bool

Gets whether the Server is in online mode or not.

online_players list[Player]

Gets a list of all currently online players.

plugin_manager PluginManager

Gets the plugin manager for interfacing with plugins.

scheduler Scheduler

Gets the scheduler for managing scheduled events.

scoreboard Scoreboard

Gets the primary Scoreboard controlled by the server.

start_time datetime

Gets the start time of the server.

version str

Gets the version of this server implementation.

average_mspt property

average_mspt: float

Gets the average milliseconds per tick (MSPT).

average_tick_usage property

average_tick_usage: float

Gets the average tick usage of the server.

average_tps property

average_tps: float

Gets the average ticks per second (TPS).

command_sender property

command_sender: ConsoleCommandSender

Gets a CommandSender for this server.

current_mspt property

current_mspt: float

Gets the current milliseconds per tick (MSPT).

current_tick_usage property

current_tick_usage: float

Gets the current tick usage of the server.

current_tps property

current_tps: float

Gets the current ticks per second (TPS).

language property

language: Language

Gets the current language interface used by the server.

level property

level: Level

Gets the server level.

logger property

logger: Logger

Returns the primary logger associated with this server instance.

max_players property writable

max_players: int

The maximum amount of players which can login to this server.

minecraft_version property

minecraft_version: str

Gets the Minecraft version that this server is running.

name property

name: str

Gets the name of this server implementation.

online_mode property

online_mode: bool

Gets whether the Server is in online mode or not.

online_players property

online_players: list[Player]

Gets a list of all currently online players.

plugin_manager property

plugin_manager: PluginManager

Gets the plugin manager for interfacing with plugins.

scheduler property

scheduler: Scheduler

Gets the scheduler for managing scheduled events.

scoreboard property

scoreboard: Scoreboard

Gets the primary Scoreboard controlled by the server.

start_time property

start_time: datetime

Gets the start time of the server.

version property

version: str

Gets the version of this server implementation.

broadcast

broadcast(
    message: str | Translatable, permission: str
) -> None

Broadcasts the specified message to every user with the given permission name.

broadcast_message

broadcast_message(message: str | Translatable) -> None

Broadcasts the specified message to every user with permission endstone.broadcast.user

create_block_data

create_block_data(
    type: str,
    block_states: dict[str, bool | str | int] | None = None,
) -> BlockData

Creates a new BlockData instance for the specified block type, with all properties initialized to defaults, except for those provided.

create_boss_bar

create_boss_bar(
    title: str,
    color: BarColor,
    style: BarStyle,
    flags: list[BarFlag] | None = None,
) -> BossBar

Creates a boss bar instance to display to players. The progress defaults to 1.0.

create_scoreboard

create_scoreboard() -> Scoreboard

Creates a new Scoreboard to be tracked by the server.

dispatch_command

dispatch_command(
    sender: CommandSender, command_line: str
) -> bool

Dispatches a command on this server, and executes it if found.

get_player

get_player(name: str) -> Player

Gets the player with the exact given name, case insensitive.

get_player(unique_id: UUID) -> Player

Gets the player with the given UUID.

get_plugin_command

get_plugin_command(name: str) -> PluginCommand

Gets a PluginCommand with the given name or alias.

reload

reload() -> None

Reloads the server configuration, functions, scripts and plugins.

reload_data

reload_data() -> None

Reload only the Minecraft data for the server.

shutdown

shutdown() -> None

Shutdowns the server, stopping everything.