endstone
Modules:
Name | Description |
---|---|
actor | |
ban | |
block | |
boss | |
command | |
damage | |
enchantments | |
event | |
form | |
inventory | |
lang | |
level | |
map | |
permissions | |
plugin | |
scheduler | |
scoreboard | |
util |
Classes:
Name | Description |
---|---|
ColorFormat | All supported color and format codes. |
EnchantmentRegistry | |
GameMode | Represents the various type of game modes that Players may have. |
ItemRegistry | |
Logger | Logger class which can format and output varies levels of logs. |
NamespacedKey | Represents a string-based key which consists of two components - a namespace and a key. |
OfflinePlayer | Represents a reference to a player identity and the data belonging to a player that is stored on the disk and can, thus, be retrieved without the player needing to be online. |
Player | Represents a player. |
Server | Represents a server implementation. |
Skin | Represents a player skin. |
ColorFormat
All supported color and format codes.
Attributes:
AQUA
AQUA: str = '§b'
BLACK
BLACK: str = '§0'
BLUE
BLUE: str = '§9'
BOLD
BOLD: str = '§l'
DARK_AQUA
DARK_AQUA: str = '§3'
DARK_BLUE
DARK_BLUE: str = '§1'
DARK_GRAY
DARK_GRAY: str = '§8'
DARK_GREEN
DARK_GREEN: str = '§2'
DARK_PURPLE
DARK_PURPLE: str = '§5'
DARK_RED
DARK_RED: str = '§4'
GOLD
GOLD: str = '§6'
GRAY
GRAY: str = '§7'
GREEN
GREEN: str = '§a'
ITALIC
ITALIC: str = '§o'
LIGHT_PURPLE
LIGHT_PURPLE: str = '§d'
MATERIAL_AMETHYST
MATERIAL_AMETHYST: str = '§u'
MATERIAL_COPPER
MATERIAL_COPPER: str = '§n'
MATERIAL_DIAMOND
MATERIAL_DIAMOND: str = '§s'
MATERIAL_EMERALD
MATERIAL_EMERALD: str = '§q'
MATERIAL_GOLD
MATERIAL_GOLD: str = '§p'
MATERIAL_IRON
MATERIAL_IRON: str = '§i'
MATERIAL_LAPIS
MATERIAL_LAPIS: str = '§t'
MATERIAL_NETHERITE
MATERIAL_NETHERITE: str = '§j'
MATERIAL_QUARTZ
MATERIAL_QUARTZ: str = '§h'
MATERIAL_REDSTONE
MATERIAL_REDSTONE: str = '§m'
MATERIAL_RESIN
MATERIAL_RESIN: str = '§v'
MINECOIN_GOLD
MINECOIN_GOLD: str = '§g'
OBFUSCATED
OBFUSCATED: str = '§k'
RED
RED: str = '§c'
RESET
RESET: str = '§r'
WHITE
WHITE: str = '§f'
YELLOW
YELLOW: str = '§e'
EnchantmentRegistry
Methods:
Name | Description |
---|---|
get | |
get_or_throw |
get
get(key:NamespacedKey) -> Enchantment
get_or_throw
get_or_throw(key:NamespacedKey) -> Enchantment
GameMode
GameMode(value:int)
Represents the various type of game modes that Players may have.
Attributes:
Name | Type | Description |
---|---|---|
ADVENTURE | GameMode | |
CREATIVE | GameMode | |
SPECTATOR | GameMode | |
SURVIVAL | GameMode | |
name | str | |
value | int |
ADVENTURE
ADVENTURE: GameMode
CREATIVE
CREATIVE: GameMode
SPECTATOR
SPECTATOR: GameMode
SURVIVAL
SURVIVAL: GameMode
name
name: str
value
value: int
ItemRegistry
Methods:
Name | Description |
---|---|
get | |
get_or_throw |
get
get(key:NamespacedKey) -> ItemType
get_or_throw
get_or_throw(key:NamespacedKey) -> ItemType
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 | Level | |
DEBUG | Level | |
ERROR | Level | |
INFO | Level | |
TRACE | Level | |
WARNING | Level | |
name | str | Get the name of this Logger instance. |
CRITICAL
CRITICAL: Logger.Level
DEBUG
DEBUG: Logger.Level
ERROR
ERROR: Logger.Level
INFO
INFO: Logger.Level
TRACE
TRACE: Logger.Level
WARNING
WARNING: Logger.Level
name
name: str
Get the name of this Logger instance.
Level
Level(value:int)
Specifies the log level.
Attributes:
CRITICAL
CRITICAL: Logger.Level
DEBUG
DEBUG: Logger.Level
ERROR
ERROR: Logger.Level
INFO
INFO: Logger.Level
TRACE
TRACE: Logger.Level
WARNING
WARNING: Logger.Level
name
name: str
value
value: int
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.
NamespacedKey
NamespacedKey(arg0:Plugin, arg1:str)
Represents a string-based key which consists of two components - a namespace and a key.
Methods:
Name | Description |
---|---|
from_string | Parses a NamespacedKey from a string. |
Attributes:
Name | Type | Description |
---|---|---|
key | str | Returns the key of the NamespacedKey. |
namespace | str | Returns the namespace of the NamespacedKey. |
key
key: str
Returns the key of the NamespacedKey.
namespace
namespace: str
Returns the namespace of the NamespacedKey.
from_string
from_string(input:str, plugin:Plugin = None) -> NamespacedKey
Parses a NamespacedKey from a string.
OfflinePlayer
Represents a reference to a player identity and the data belonging to a player that is stored on the disk and can, thus, be retrieved without the player needing to be online.
Attributes:
Name | Type | Description |
---|---|---|
name | str | Returns the name of this player |
unique_id | UUID | Returns the UUID of this player |
name
name: str
Returns the name of this player
unique_id
unique_id: uuid.UUID
Returns the UUID of this player
Player
Bases: Mob
, OfflinePlayer
Represents a player.
Methods:
Name | Description |
---|---|
close_form | Closes the forms that are currently open for the player. |
give_exp | Gives the player the amount of experience specified. |
give_exp_levels | Gives the player the amount of experience levels specified. |
kick | Kicks player with custom kick message. |
perform_command | Makes the player perform the given command. |
play_sound | Play a sound for a player at the location. |
reset_title | Resets the title displayed to the player. This will clear the displayed title / subtitle and reset timings to their default values. |
send_form | Sends a form to the player. |
send_packet | Sends a packet to the player. |
send_popup | Sends this player a popup message |
send_tip | Sends this player a tip message |
send_title | Sends a title and a subtitle message to the player. If they are empty strings, the display will be updated as such. |
send_toast | Sends this player a toast notification. |
spawn_particle | Spawns the particle at the target location. |
stop_all_sounds | Stop all sounds from playing. |
stop_sound | Stop the specified sound from playing. |
transfer | Transfers the player to another server. |
update_commands | Send the list of commands to the client. |
Attributes:
Name | Type | Description |
---|---|---|
address | SocketAddress | Gets the socket address of this player |
allow_flight | bool | If the Player is allowed to fly via jump key double-tap. |
device_id | str | Get the player’s current device id. |
device_os | str | Get the player’s current device’s operation system (OS). |
ender_chest | Inventory | Get the player’s EnderChest inventory. |
exp_level | int | Gets or sets the players current experience level. |
exp_progress | float | Gets or sets the players current experience progress towards the next level. |
fly_speed | float | Gets or sets the current allowed speed that a client can fly. |
game_mode | GameMode | The player’s current game mode. |
game_version | str | Get the player’s current game version. |
inventory | PlayerInventory | Get the player’s inventory. |
is_flying | bool | If the player is currently flying or not. |
is_op | bool | The operator status of this playerall |
is_sneaking | bool | Gets or sets the sneak mode of the player |
is_sprinting | bool | Gets or sets whether the player is sprinting or not. |
locale | str | Get the player’s current locale. |
name | str | Returns the name of this player |
ping | int | Gets the player’s average ping in milliseconds. |
scoreboard | Scoreboard | Gets or sets the player’s visible Scoreboard. |
skin | Skin | Get the player’s skin. |
total_exp | int | Gets the players total experience points. |
unique_id | UUID | Returns the UUID of this player |
walk_speed | float | Gets or sets the current allowed speed that a client can walk. |
xuid | str | Returns the Xbox User ID (XUID) of this player |
address
address: SocketAddress
Gets the socket address of this player
allow_flight
allow_flight: bool
If the Player is allowed to fly via jump key double-tap.
device_id
device_id: str
Get the player’s current device id.
device_os
device_os: str
Get the player’s current device’s operation system (OS).
ender_chest
ender_chest: Inventory
Get the player’s EnderChest inventory.
exp_level
exp_level: int
Gets or sets the players current experience level.
exp_progress
exp_progress: float
Gets or sets the players current experience progress towards the next level.
fly_speed
fly_speed: float
Gets or sets the current allowed speed that a client can fly.
game_mode
game_mode: GameMode
The player’s current game mode.
game_version
game_version: str
Get the player’s current game version.
inventory
inventory: PlayerInventory
Get the player’s inventory.
is_flying
is_flying: bool
If the player is currently flying or not.
is_op
is_op: bool
The operator status of this playerall
is_sneaking
is_sneaking: bool
Gets or sets the sneak mode of the player
is_sprinting
is_sprinting: bool
Gets or sets whether the player is sprinting or not.
locale
locale: str
Get the player’s current locale.
name
name: str
Returns the name of this player
ping
ping: int
Gets the player’s average ping in milliseconds.
scoreboard
scoreboard: Scoreboard
Gets or sets the player’s visible Scoreboard.
skin
skin: Skin
Get the player’s skin.
total_exp
total_exp: int
Gets the players total experience points.
unique_id
unique_id: uuid.UUID
Returns the UUID of this player
walk_speed
walk_speed: float
Gets or sets the current allowed speed that a client can walk.
xuid
xuid: str
Returns the Xbox User ID (XUID) of this player
close_form
close_form() -> None
Closes the forms that are currently open for the player.
give_exp
give_exp(amount:int) -> None
Gives the player the amount of experience specified.
give_exp_levels
give_exp_levels(amount:int) -> None
Gives the player the amount of experience levels specified.
kick
kick(message:str) -> None
Kicks player with custom kick message.
perform_command
perform_command(command:str) -> bool
Makes the player perform the given command.
play_sound
play_sound(
location: Location, sound: str, volume: float = 1.0, pitch: float = 1.0
) -> None
Play a sound for a player at the location.
reset_title
reset_title() -> None
Resets the title displayed to the player. This will clear the displayed title / subtitle and reset timings to their default values.
send_form
send_form(form:MessageForm | ActionForm | ModalForm) -> None
Sends a form to the player.
send_packet
send_packet(packet_id:int, payload:bytes) -> None
Sends a packet to the player.
send_popup
send_popup(message:str) -> None
Sends this player a popup message
send_tip
send_tip(message:str) -> None
Sends this player a tip message
send_title
send_title(
title: str,
subtitle: str,
fade_in: int = 10,
stay: int = 70,
fade_out: int = 20,
) -> None
Sends a title and a subtitle message to the player. If they are empty strings, the display will be updated as such.
send_toast
send_toast(title:str, content:str) -> None
Sends this player a toast notification.
spawn_particle
spawn_particle(
name: str, location: Location, molang_variables_json: str | None = None
) -> None
Spawns the particle at the target location.
spawn_particle(
name: str,
x: float,
y: float,
z: float,
molang_variables_json: str | None = None,
) -> None
Spawns the particle at the target location.
stop_all_sounds
stop_all_sounds() -> None
Stop all sounds from playing.
stop_sound
stop_sound(sound:str) -> None
Stop the specified sound from playing.
transfer
transfer(host:str, port:int = 19132) -> None
Transfers the player to another server.
update_commands
update_commands() -> None
Send the list of commands to the client.
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 | Gets the player with the exact given name, case insensitive. Gets the player with the given UUID. |
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). |
ban_list | PlayerBanList | Gets the player ban list. |
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). |
enchantment_registry | EnchantmentRegistry | Returns the registry for all the enchantments. |
ip_ban_list | IpBanList | Gets the IP ban list. |
item_factory | ItemFactory | Gets the instance of the item factory (for ItemMeta). |
item_registry | ItemRegistry | Returns the registry for all the item types. |
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. |
port | int | Get the game port that the server runs on. |
port_v6 | int | Get the game port (IPv6) that the server runs on. |
protocol_version | int | Gets the network protocol version that this server supports. |
scheduler | Scheduler | Gets the scheduler for managing scheduled events. |
scoreboard | Scoreboard | Gets the primary Scoreboard controlled by the server. |
service_manager | ServiceManager | Gets the service manager. |
start_time | datetime | Gets the start time of the server. |
version | str | Gets the version of this server implementation. |
average_mspt
average_mspt: float
Gets the average milliseconds per tick (MSPT).
average_tick_usage
average_tick_usage: float
Gets the average tick usage of the server.
average_tps
average_tps: float
Gets the average ticks per second (TPS).
ban_list
ban_list: PlayerBanList
Gets the player ban list.
command_sender
command_sender: ConsoleCommandSender
Gets a CommandSender for this server.
current_mspt
current_mspt: float
Gets the current milliseconds per tick (MSPT).
current_tick_usage
current_tick_usage: float
Gets the current tick usage of the server.
current_tps
current_tps: float
Gets the current ticks per second (TPS).
enchantment_registry
enchantment_registry: EnchantmentRegistry
Returns the registry for all the enchantments.
ip_ban_list
ip_ban_list: IpBanList
Gets the IP ban list.
item_factory
item_factory: ItemFactory
Gets the instance of the item factory (for ItemMeta).
item_registry
item_registry: ItemRegistry
Returns the registry for all the item types.
language
language: Language
Gets the current language interface used by the server.
level
level: Level
Gets the server level.
logger
logger: Logger
Returns the primary logger associated with this server instance.
max_players
max_players: int
The maximum amount of players which can login to this server.
minecraft_version
minecraft_version: str
Gets the Minecraft version that this server is running.
name
name: str
Gets the name of this server implementation.
online_mode
online_mode: bool
Gets whether the Server is in online mode or not.
online_players
online_players: list[Player]
Gets a list of all currently online players.
plugin_manager
plugin_manager: PluginManager
Gets the plugin manager for interfacing with plugins.
port
port: int
Get the game port that the server runs on.
port_v6
port_v6: int
Get the game port (IPv6) that the server runs on.
protocol_version
protocol_version: int
Gets the network protocol version that this server supports.
scheduler
scheduler: Scheduler
Gets the scheduler for managing scheduled events.
scoreboard
scoreboard: Scoreboard
Gets the primary Scoreboard controlled by the server.
service_manager
service_manager: ServiceManager
Gets the service manager.
start_time
start_time: datetime.datetime
Gets the start time of the server.
version
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.
Skin
Skin(
id: str,
image: ndarray[uint8],
cape_id: str | None = None,
cape_image: ndarray[uint8] | None = None,
)
Represents a player skin.
Attributes:
Name | Type | Description |
---|---|---|
cape_id | str | None | Get the Cape ID. |
cape_image | ndarray[uint8] | Get the Cape image. |
id | str | Get the Skin ID. |
image | ndarray[uint8] | Get the Skin image. |
cape_id
cape_id: str | None
Get the Cape ID.
cape_image
cape_image: numpy.ndarray[numpy.uint8]
Get the Cape image.
id
id: str
Get the Skin ID.
image
image: numpy.ndarray[numpy.uint8]
Get the Skin image.