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. |
command_sender
property
¶
command_sender: ConsoleCommandSender
Gets a CommandSender for this server.
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.
plugin_manager
property
¶
plugin_manager: PluginManager
Gets the plugin manager for interfacing with plugins.
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
¶
Gets the player with the exact given name, case insensitive.
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.