Skip to Content
⚠ Under Construction
ReferencePython APIendstone

endstone

Modules:

Classes:

NameDescription
ColorFormatAll supported color and format codes.
EnchantmentRegistry
GameModeRepresents the various type of game modes that Players may have.
ItemRegistry
LoggerLogger class which can format and output varies levels of logs.
NamespacedKeyRepresents a string-based key which consists of two components - a namespace and a key.
OfflinePlayerRepresents 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.
PlayerRepresents a player.
ServerRepresents a server implementation.
SkinRepresents 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:

NameDescription
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:

ADVENTURE

ADVENTURE: GameMode

CREATIVE

CREATIVE: GameMode

SPECTATOR

SPECTATOR: GameMode

SURVIVAL

SURVIVAL: GameMode

name

name: str

value

value: int

ItemRegistry

Methods:

NameDescription
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:

NameDescription
LevelSpecifies the log level.

Methods:

NameDescription
criticalLog a message at the CRITICAL level.
debugLog a message at the DEBUG level.
errorLog a message at the ERROR level.
infoLog a message at the INFO level.
is_enabled_forCheck if the Logger instance is enabled for the given log Level.
set_levelSet the logging level for this Logger instance.
traceLog a message at the TRACE level.
warningLog a message at the WARNING level.

Attributes:

NameTypeDescription
CRITICALLevel
DEBUGLevel
ERRORLevel
INFOLevel
TRACELevel
WARNINGLevel
namestrGet 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:

NameDescription
from_stringParses a NamespacedKey from a string.

Attributes:

NameTypeDescription
keystrReturns the key of the NamespacedKey.
namespacestrReturns 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:

NameTypeDescription
namestrReturns the name of this player
unique_idUUIDReturns 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:

NameDescription
close_formCloses the forms that are currently open for the player.
give_expGives the player the amount of experience specified.
give_exp_levelsGives the player the amount of experience levels specified.
kickKicks player with custom kick message.
perform_commandMakes the player perform the given command.
play_soundPlay a sound for a player at the location.
reset_titleResets the title displayed to the player. This will clear the displayed title / subtitle and reset timings to their default values.
send_formSends a form to the player.
send_packetSends a packet to the player.
send_popupSends this player a popup message
send_tipSends this player a tip message
send_titleSends a title and a subtitle message to the player. If they are empty strings, the display will be updated as such.
send_toastSends this player a toast notification.
spawn_particleSpawns the particle at the target location.
stop_all_soundsStop all sounds from playing.
stop_soundStop the specified sound from playing.
transferTransfers the player to another server.
update_commandsSend the list of commands to the client.

Attributes:

NameTypeDescription
addressSocketAddressGets the socket address of this player
allow_flightboolIf the Player is allowed to fly via jump key double-tap.
device_idstrGet the player’s current device id.
device_osstrGet the player’s current device’s operation system (OS).
ender_chestInventoryGet the player’s EnderChest inventory.
exp_levelintGets or sets the players current experience level.
exp_progressfloatGets or sets the players current experience progress towards the next level.
fly_speedfloatGets or sets the current allowed speed that a client can fly.
game_modeGameModeThe player’s current game mode.
game_versionstrGet the player’s current game version.
inventoryPlayerInventoryGet the player’s inventory.
is_flyingboolIf the player is currently flying or not.
is_opboolThe operator status of this playerall
is_sneakingboolGets or sets the sneak mode of the player
is_sprintingboolGets or sets whether the player is sprinting or not.
localestrGet the player’s current locale.
namestrReturns the name of this player
pingintGets the player’s average ping in milliseconds.
scoreboardScoreboardGets or sets the player’s visible Scoreboard.
skinSkinGet the player’s skin.
total_expintGets the players total experience points.
unique_idUUIDReturns the UUID of this player
walk_speedfloatGets or sets the current allowed speed that a client can walk.
xuidstrReturns 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:

NameDescription
broadcastBroadcasts the specified message to every user with the given permission name.
broadcast_messageBroadcasts the specified message to every user with permission endstone.broadcast.user
create_block_dataCreates a new BlockData instance for the specified block type, with all properties initialized to defaults, except for those provided.
create_boss_barCreates a boss bar instance to display to players. The progress defaults to 1.0.
create_scoreboardCreates a new Scoreboard to be tracked by the server.
dispatch_commandDispatches a command on this server, and executes it if found.
get_playerGets the player with the exact given name, case insensitive.
Gets the player with the given UUID.
get_plugin_commandGets a PluginCommand with the given name or alias.
reloadReloads the server configuration, functions, scripts and plugins.
reload_dataReload only the Minecraft data for the server.
shutdownShutdowns the server, stopping everything.

Attributes:

NameTypeDescription
average_msptfloatGets the average milliseconds per tick (MSPT).
average_tick_usagefloatGets the average tick usage of the server.
average_tpsfloatGets the average ticks per second (TPS).
ban_listPlayerBanListGets the player ban list.
command_senderConsoleCommandSenderGets a CommandSender for this server.
current_msptfloatGets the current milliseconds per tick (MSPT).
current_tick_usagefloatGets the current tick usage of the server.
current_tpsfloatGets the current ticks per second (TPS).
enchantment_registryEnchantmentRegistryReturns the registry for all the enchantments.
ip_ban_listIpBanListGets the IP ban list.
item_factoryItemFactoryGets the instance of the item factory (for ItemMeta).
item_registryItemRegistryReturns the registry for all the item types.
languageLanguageGets the current language interface used by the server.
levelLevelGets the server level.
loggerLoggerReturns the primary logger associated with this server instance.
max_playersintThe maximum amount of players which can login to this server.
minecraft_versionstrGets the Minecraft version that this server is running.
namestrGets the name of this server implementation.
online_modeboolGets whether the Server is in online mode or not.
online_playerslist[Player]Gets a list of all currently online players.
plugin_managerPluginManagerGets the plugin manager for interfacing with plugins.
portintGet the game port that the server runs on.
port_v6intGet the game port (IPv6) that the server runs on.
protocol_versionintGets the network protocol version that this server supports.
schedulerSchedulerGets the scheduler for managing scheduled events.
scoreboardScoreboardGets the primary Scoreboard controlled by the server.
service_managerServiceManagerGets the service manager.
start_timedatetimeGets the start time of the server.
versionstrGets 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:

NameTypeDescription
cape_idstr | NoneGet the Cape ID.
cape_imagendarray[uint8]Get the Cape image.
idstrGet the Skin ID.
imagendarray[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.

Last updated on