endstone

Classes

NameDescription
ColorFormatAll supported color and format codes.
IRegistry
IdentifierRepresents a identifier consisting of two components: a namespace and a key.
LoggerLogger class which can format and output varies levels of logs.
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.
Preconditions
RegistryAbstract registry interface for objects with identifiers.
ServerRepresents a server implementation.
SkinRepresents a player skin.
TypeCRTP base for registry-backed types identified by an Identifier.
overloadedHelper type for visitors.

Enums

NameDescription
GameModeRepresents the various type of game modes that Players may have.

Type Aliases

NameDescription
Message

Functions

NameDescription
overloadedDeduction guide.

structColorFormat

Defined in <endstone/color_format.h>

All supported color and format codes.

Variables

varEscapestatic

const std::string Escape

varBlackstatic

const std::string Black

varDarkBluestatic

const std::string DarkBlue

varDarkGreenstatic

const std::string DarkGreen

varDarkAquastatic

const std::string DarkAqua

varDarkRedstatic

const std::string DarkRed

varDarkPurplestatic

const std::string DarkPurple

varGoldstatic

const std::string Gold

varGraystatic

const std::string Gray

varDarkGraystatic

const std::string DarkGray

varBluestatic

const std::string Blue

varGreenstatic

const std::string Green

varAquastatic

const std::string Aqua

varRedstatic

const std::string Red

varLightPurplestatic

const std::string LightPurple

varYellowstatic

const std::string Yellow

varWhitestatic

const std::string White

varMinecoinGoldstatic

const std::string MinecoinGold

varMaterialQuartzstatic

const std::string MaterialQuartz

varMaterialIronstatic

const std::string MaterialIron

varMaterialNetheritestatic

const std::string MaterialNetherite

varMaterialRedstonestatic

const std::string MaterialRedstone

varMaterialCopperstatic

const std::string MaterialCopper

varMaterialGoldstatic

const std::string MaterialGold

varMaterialEmeraldstatic

const std::string MaterialEmerald

varMaterialDiamondstatic

const std::string MaterialDiamond

varMaterialLapisstatic

const std::string MaterialLapis

varMaterialAmethyststatic

const std::string MaterialAmethyst

varMaterialResinstatic

const std::string MaterialResin

varObfuscatedstatic

const std::string Obfuscated

varBoldstatic

const std::string Bold

varItalicstatic

const std::string Italic

varResetstatic

const std::string Reset

classIRegistry

Defined in <endstone/registry.h>

Methods

NameDescription
~IRegistry

meth~IRegistryvirtual

~IRegistry() =default

classIdentifier

Defined in <endstone/identifier.h>

Represents a identifier consisting of two components: a namespace and a key.

Variables

NameDescription
MinecraftThe namespace representing all inbuilt keys.

Methods

varMinecraftstaticconstexpr

The namespace representing all inbuilt keys.

methIdentifierconstexprnoexcept

constexpr Identifier(const char* s) noexcept

methIdentifierconstexprnoexcept

constexpr Identifier(const std::string& s) noexcept

methIdentifierconstexprnoexcept

constexpr Identifier(const std::string_view& identifier) noexcept

methIdentifierconstexprnoexcept

constexpr Identifier(const std::string_view& namespace_, const std::string_view& key) noexcept

methgetNamespaceconstconstexprnoexcept

std::string_view getNamespace() const noexcept

methgetKeyconstconstexprnoexcept

std::string_view getKey() const noexcept

methoperator==constconstexprnoexcept

bool operator==(const Identifier& other) const noexcept

methoperator!=constconstexprnoexcept

bool operator!=(const Identifier& other) const noexcept

methoperator std::stringconst

operator std::string() const

methminecraftstaticconstexprnoexcept

Identifier minecraft(const std::string_view key) noexcept

classLogger

Defined in <endstone/logger.h>

Logger class which can format and output varies levels of logs.

Enums

NameDescription
LevelSpecifies the log level.

Methods

NameDescription
Logger
~Logger
setLevelSet the logging level for this Logger instance.
isEnabledForCheck if the Logger instance is enabled for the given log Level.
getNameGet the name of this Logger instance.
logLog a message at the given level.
log
trace
trace
debug
debug
info
info
warning
warning
error
error
critical
critical

enumLevel

Specifies the log level.

Values

NameValueDescription
Trace0
Debug1
Info2
Warning3
Error4
Critical5
Off6

methLogger

Logger() =default

meth~Loggervirtual

~Logger() =default

methsetLevelabstract

void setLevel(Level level) =0

Set the logging level for this Logger instance.

Parameters

NameTypeDescription
levelLevelThe desired log level

methisEnabledForabstractconst

bool isEnabledFor(Level level) const =0

Check if the Logger instance is enabled for the given log Level.

Parameters

NameTypeDescription
levelLevelThe log level to check

Returns

TypeDescription
booltrue if the logger is enabled for the Level, false otherwise.

methgetNameabstractconst

std::string_view getName() const =0

Get the name of this Logger instance.

Returns

TypeDescription
std::string_viewThe name of this Logger instance.

methlogabstractconst

void log(Level level, std::string_view message) const =0

Log a message at the given level.

Parameters

NameTypeDescription
levelLevelThe level at which the message should be logged.
messagestd::string_viewThe message to log.

methlogconst

void log(Level level, const std::format_string<Args...> format, Args&&... args) const

methtraceconst

void trace(const std::string_view message) const

methtraceconst

void trace(const std::format_string<Args...> format, Args&&... args) const

methdebugconst

void debug(const std::string_view message) const

methdebugconst

void debug(const std::format_string<Args...> format, Args&&... args) const

methinfoconst

void info(const std::string_view message) const

methinfoconst

void info(const std::format_string<Args...> format, Args&&... args) const

methwarningconst

void warning(const std::string_view message) const

methwarningconst

void warning(const std::format_string<Args...> format, Args&&... args) const

metherrorconst

void error(const std::string_view message) const

metherrorconst

void error(const std::format_string<Args...> format, Args&&... args) const

methcriticalconst

void critical(const std::string_view message) const

methcriticalconst

void critical(const std::format_string<Args...> format, Args&&... args) const

classOfflinePlayer

Defined in <endstone/offline_player.h>

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.

Methods

NameDescription
~OfflinePlayer
getNameReturns the name of this player.
getUniqueIdReturns the UUID of this player.

meth~OfflinePlayervirtual

~OfflinePlayer() =default

methgetNameabstractconst

std::string getName() const =0

Returns the name of this player.

Returns

TypeDescription
std::stringPlayer name or null if we have not seen a name for this player yet

methgetUniqueIdabstractconst

UUID getUniqueId() const =0

Returns the UUID of this player.

Returns

TypeDescription
UUIDPlayerUUID

classPlayer

Defined in <endstone/player.h>

Bases: Mob, OfflinePlayer

Represents a player.

Type Aliases

NameDescription
FormVariant

Methods

NameDescription
getNameReturns the name of this player.
isOpChecks if this player is a server operator.
setOpSets the operator status of this player.
getXuidReturns the Xbox User ID (XUID) of this player.
getAddressGets the socket address of this player.
transferTransfers the player to another server.
kickKicks player with custom kick message.
performCommandMakes the player perform the given command.
isSneakingReturns if the player is in sneak mode.
setSneakingSets the sneak mode of the player.
isSprintingGets whether the player is sprinting or not.
setSprintingSets whether the player is sprinting or not.
playSoundPlay a sound for a player at the location.
stopSoundStop the specified sound from playing.
stopAllSoundsStop all sounds from playing.
giveExpGives the player the amount of experience specified.
giveExpLevelsGives the player the amount of experience levels specified.
getExpProgressGets the players current experience progress towards the next level.
setExpProgressSets the players current experience progress towards the next level.
getExpLevelGets the players current experience level.
setExpLevelSets the players current experience level.
getTotalExpGets the players total experience points.
getAllowFlightDetermines if the Player is allowed to fly via jump key double-tap.
setAllowFlightSets if the Player is allowed to fly via jump key double-tap.
isFlyingChecks to see if this player is currently flying or not.
setFlyingMakes this player start or stop flying.
getFlySpeedGets the current allowed speed that a client can fly.
setFlySpeed
getWalkSpeedGets the current allowed speed that a client can walk.
setWalkSpeed
getScoreboardGets the Scoreboard displayed to this player.
setScoreboard
sendPopupSends this player a popup message.
sendTipSends this player a tip message.
sendToastSends this player a toast notification.
sendTitleSends a title and a subtitle message to the player. If they are empty strings, the display will be updated as such. The titles will be displayed with the default timings.
sendTitleSends a title and a subtitle message to the player. If they are empty strings, the display will be updated as such.
resetTitleResets the title displayed to the player. This will clear the displayed title / subtitle and reset timings to their default values.
spawnParticleSpawns the particle at the target location.
spawnParticleSpawns the particle at the target location.
spawnParticleSpawns the particle at the target location.
spawnParticleSpawns the particle at the target location.
getPingGets the player's average ping.
getLocaleGets the player's current locale.
updateCommandsSend the list of commands to the client.
getInventoryGet the player's inventory.
getEnderChestGet the player's EnderChest inventory.
getGameModeGets this player's current GameMode.
setGameModeSets this player's current GameMode.
getDeviceOSGets the player's current device's operation system (OS).
getDeviceIdGets the player's current device id.
getGameVersionGets the player's current game version.
getSkinGets the player's skin.
sendFormSends a form to the player.
closeFormCloses the forms that are currently open for the player.
sendPacketSends a packet to the player.
sendMapRender a map and send it to the player in its entirety.

typeFormVariantprotected

methgetNameabstractconstoverride

std::string getName() const override=0

Returns the name of this player.

Returns

TypeDescription
std::stringPlayer name or null if we have not seen a name for this player yet

methisOpabstractconst

bool isOp() const =0

Checks if this player is a server operator.

Returns

TypeDescription
booltrue if this is an operator, otherwise false

methsetOpabstract

void setOp(bool value) =0

Sets the operator status of this player.

Parameters

NameTypeDescription
valueboolNew operator value

methgetXuidabstractconst

std::string getXuid() const =0

Returns the Xbox User ID (XUID) of this player.

Returns

TypeDescription
std::stringPlayer XUID

methgetAddressabstractconst

SocketAddress getAddress() const =0

Gets the socket address of this player.

Returns

TypeDescription
SocketAddressthe player's socket address

methtransferabstractconst

void transfer(std::string host, int port) const =0

Transfers the player to another server.

Parameters

NameTypeDescription
hoststd::stringServer address to transfer the player to.
portintServer port to transfer the player to

methkickabstractconst

void kick(std::string message) const =0

Kicks player with custom kick message.

Parameters

NameTypeDescription
messagestd::stringkick message

methperformCommandabstractconst

bool performCommand(std::string command) const =0

Makes the player perform the given command.

Parameters

NameTypeDescription
commandstd::stringCommand to perform

Returns

TypeDescription
booltrue if the command was successful, otherwise false

methisSneakingabstractconst

bool isSneaking() const =0

Returns if the player is in sneak mode.

Returns

TypeDescription
booltrue if player is in sneak mode

methsetSneakingabstract

void setSneaking(bool sneak) =0

Sets the sneak mode of the player.

Parameters

NameTypeDescription
sneakbooltrue if player should appear sneaking

methisSprintingabstractconst

bool isSprinting() const =0

Gets whether the player is sprinting or not.

Returns

TypeDescription
booltrue if player is sprinting.

methsetSprintingabstract

void setSprinting(bool sprinting) =0

Sets whether the player is sprinting or not.

Parameters

NameTypeDescription
sprintingbooltrue if the player should be sprinting

methplaySoundabstract

void playSound(Location location, std::string sound, float volume, float pitch) =0

Play a sound for a player at the location.

Parameters

NameTypeDescription
locationLocationThe location to play the sound
soundstd::stringThe internal sound name to play
volumefloatThe volume of the sound
pitchfloatThe pitch of the sound

methstopSoundabstract

void stopSound(std::string sound) =0

Stop the specified sound from playing.

Parameters

NameTypeDescription
soundstd::stringthe sound to stop

methstopAllSoundsabstract

void stopAllSounds() =0

Stop all sounds from playing.

methgiveExpabstract

void giveExp(int amount) =0

Gives the player the amount of experience specified.

Parameters

NameTypeDescription
amountintExp amount to give

methgiveExpLevelsabstract

void giveExpLevels(int amount) =0

Gives the player the amount of experience levels specified.

Parameters

NameTypeDescription
amountintamount of experience levels to give or take

methgetExpProgressabstractconst

float getExpProgress() const =0

Gets the players current experience progress towards the next level.

This is a percentage value. 0.0 is "no progress" and 1.0 is "next level".

Returns

TypeDescription
floatCurrent experience points

methsetExpProgressabstract

void setExpProgress(float progress) =0

Sets the players current experience progress towards the next level.

This is a percentage value. 0.0 is "no progress" and 1.0 is "next level".

Parameters

NameTypeDescription
progressfloatNew experience progress

methgetExpLevelabstractconst

int getExpLevel() const =0

Gets the players current experience level.

Returns

TypeDescription
intCurrent experience level

methsetExpLevelabstract

void setExpLevel(int level) =0

Sets the players current experience level.

Parameters

NameTypeDescription
levelintNew experience level

methgetTotalExpabstractconst

int getTotalExp() const =0

Gets the players total experience points.

This refers to the total amount of experience the player has collected over time and is not currently displayed to the client.

Returns

TypeDescription
intCurrent total experience points

methgetAllowFlightabstractconst

bool getAllowFlight() const =0

Determines if the Player is allowed to fly via jump key double-tap.

Returns

TypeDescription
boolTrue if the player is allowed to fly.

methsetAllowFlightabstract

void setAllowFlight(bool flight) =0

Sets if the Player is allowed to fly via jump key double-tap.

Parameters

NameTypeDescription
flightboolIf flight should be allowed.

methisFlyingabstractconst

bool isFlying() const =0

Checks to see if this player is currently flying or not.

Returns

TypeDescription
boolTrue if the player is flying, else false.

methsetFlyingabstract

void setFlying(bool value) =0

Makes this player start or stop flying.

Parameters

NameTypeDescription
valueboolTrue to fly.

methgetFlySpeedabstractconst

float getFlySpeed() const =0

Gets the current allowed speed that a client can fly.

Returns

TypeDescription
floatThe current allowed speed, default is 0.05.

methsetFlySpeedabstractconst

void setFlySpeed(float value) const =0

Sets the speed at which a client will fly.

Parameters

NameTypeDescription
valuefloatThe new speed.

methgetWalkSpeedabstractconst

float getWalkSpeed() const =0

Gets the current allowed speed that a client can walk.

Returns

TypeDescription
floatThe current allowed speed, default is 0.10.

methsetWalkSpeedabstractconst

void setWalkSpeed(float value) const =0

Sets the speed at which a client will walk.

Parameters

NameTypeDescription
valuefloatThe new speed.

methgetScoreboardabstractconst

Scoreboard& getScoreboard() const =0

Gets the Scoreboard displayed to this player.

Returns

TypeDescription
Scoreboard&The current scoreboard seen by this player

methsetScoreboardabstract

void setScoreboard(Scoreboard& scoreboard) =0

@breif Sets the player's visible Scoreboard.

Parameters

NameTypeDescription
scoreboardScoreboard&New Scoreboard for the player

methsendPopupabstractconst

void sendPopup(std::string message) const =0

Sends this player a popup message.

Parameters

NameTypeDescription
messagestd::stringMessage to be displayed

methsendTipabstractconst

void sendTip(std::string message) const =0

Sends this player a tip message.

Parameters

NameTypeDescription
messagestd::stringMessage to be displayed

methsendToastabstractconst

void sendToast(std::string title, std::string content) const =0

Sends this player a toast notification.

Parameters

NameTypeDescription
titlestd::stringThe title of the toast notification.
contentstd::stringThe content of the toast notification.

methsendTitleabstractconst

void sendTitle(std::string title, std::string subtitle) const =0

Sends a title and a subtitle message to the player. If they are empty strings, the display will be updated as such. The titles will be displayed with the default timings.

Parameters

NameTypeDescription
titlestd::stringTitle text
subtitlestd::stringSubtitle text

methsendTitleabstractconst

void sendTitle(std::string title, std::string subtitle, int fade_in, int stay, int fade_out) const =0

Sends a title and a subtitle message to the player. If they are empty strings, the display will be updated as such.

Parameters

NameTypeDescription
titlestd::stringTitle text
subtitlestd::stringSubtitle text
fade_ininttime in ticks for titles to fade in. Defaults to 10.
stayinttime in ticks for titles to stay. Defaults to 70.
fade_outinttime in ticks for titles to fade out. Defaults to 20.

methresetTitleabstractconst

void resetTitle() const =0

Resets the title displayed to the player. This will clear the displayed title / subtitle and reset timings to their default values.

methspawnParticleabstractconst

void spawnParticle(std::string name, Location location) const =0

Spawns the particle at the target location.

Parameters

NameTypeDescription
namestd::stringthe name of the particle effect to spawn
locationLocationthe location to spawn at

methspawnParticleabstractconst

void spawnParticle(std::string name, float x, float y, float z) const =0

Spawns the particle at the target location.

Parameters

NameTypeDescription
namestd::stringthe name of the particle effect to spawn
xfloatthe position on the x axis to spawn at
yfloatthe position on the y axis to spawn at
zfloatthe position on the z axis to spawn at

methspawnParticleabstractconst

void spawnParticle(std::string name, Location location, std::optional<std::string> molang_variables_json) const =0

Spawns the particle at the target location.

Parameters

NameTypeDescription
namestd::stringthe name of the particle effect to spawn
locationLocationthe location to spawn at
molang_variables_jsonstd::optional<std::string>the customizable molang variables that can be adjusted for this particle, in json

methspawnParticleabstractconst

void spawnParticle(std::string name, float x, float y, float z, std::optional<std::string> molang_variables_json) const =0

Spawns the particle at the target location.

Parameters

NameTypeDescription
namestd::stringthe name of the particle effect to spawn
xfloatthe position on the x axis to spawn at
yfloatthe position on the y axis to spawn at
zfloatthe position on the z axis to spawn at
molang_variables_jsonstd::optional<std::string>the customizable molang variables that can be adjusted for this particle, in json

methgetPingabstractconst

std::chrono::milliseconds getPing() const =0

Gets the player's average ping.

Returns

TypeDescription
std::chrono::millisecondsplayer ping

methgetLocaleabstractconst

std::string getLocale() const =0

Gets the player's current locale.

Returns

TypeDescription
std::stringthe player's locale

methupdateCommandsabstractconst

void updateCommands() const =0

Send the list of commands to the client.

Generally useful to ensure the client has a complete list of commands after permission changes are done.

methgetInventoryabstractconst

PlayerInventory& getInventory() const =0

Get the player's inventory.

Returns

TypeDescription
PlayerInventory&The inventory of the player, this also contains the armor slots.

methgetEnderChestabstractconst

Inventory& getEnderChest() const =0

Get the player's EnderChest inventory.

Returns

TypeDescription
Inventory&The EnderChest of the player

methgetGameModeabstractconst

GameMode getGameMode() const =0

Gets this player's current GameMode.

Returns

TypeDescription
GameModeCurrent game mode

methsetGameModeabstract

void setGameMode(GameMode mode) =0

Sets this player's current GameMode.

Parameters

NameTypeDescription
modeGameModeNew game mode

methgetDeviceOSabstractconst

std::string getDeviceOS() const =0

Gets the player's current device's operation system (OS).

Returns

TypeDescription
std::stringthe player's device OS

methgetDeviceIdabstractconst

std::string getDeviceId() const =0

Gets the player's current device id.

Returns

TypeDescription
std::stringthe player's device id

methgetGameVersionabstractconst

std::string getGameVersion() const =0

Gets the player's current game version.

Returns

TypeDescription
std::stringthe player's game version

methgetSkinabstractconst

Skin getSkin() const =0

Gets the player's skin.

Returns

TypeDescription
Skinthe player's skin

methsendFormabstract

void sendForm(FormVariant form) =0

Sends a form to the player.

Parameters

NameTypeDescription
formFormVariantThe form to send

methcloseFormabstract

void closeForm() =0

Closes the forms that are currently open for the player.

methsendPacketabstractconst

void sendPacket(int packet_id, std::string_view payload) const =0

Sends a packet to the player.

Parameters

NameTypeDescription
packet_idintThe packet ID to be sent.
payloadstd::string_viewThe payload of the packet to be transmitted.

methsendMapabstract

void sendMap(MapView& map) =0

Render a map and send it to the player in its entirety.

This may be used when streaming the map in the normal manner is not desirable.

Parameters

NameTypeDescription
mapMapView&The map to send

classPreconditions

Defined in <endstone/check.h>

Methods

methcheckArgumentstatic

void checkArgument(bool condition, std::format_string<Args...> format, Args&&... args)

methcheckStatestatic

void checkState(bool condition, std::format_string<Args...> format, Args&&... args)

classRegistry

Defined in <endstone/registry.h>

Bases: IRegistry

Abstract registry interface for objects with identifiers.

Provides lookup by identifier (nullable or exception-throwing) and iteration.

Methods

NameDescription
getGet the object by its identifier.
getGet the object by its identifier.
getOrThrowGet the object by its identifier or throw if missing.
getOrThrowGet the object by its identifier or throw if missing.
forEachApply a function to each stored element.

methgetabstractnoexcept

T* get(Identifier<T> id) noexcept=0

Get the object by its identifier.

Returns a raw pointer to the object, or nullptr if not found.

Parameters

NameTypeDescription
idIdentifier<T>Identifier to look up.

Returns

TypeDescription
T*T* Pointer to the object, or nullptr if it does not exist.

methgetabstractconstnoexcept

const T* get(Identifier<T> id) const noexcept=0

Get the object by its identifier.

Returns a raw pointer to the object, or nullptr if not found.

Parameters

NameTypeDescription
idIdentifier<T>Non-null identifier to look up.

Returns

TypeDescription
const T*const T* Pointer to the object, or nullptr if it does not exist.

methgetOrThrowvirtual

T& getOrThrow(Identifier<T> id)

Get the object by its identifier or throw if missing.

Parameters

NameTypeDescription
idIdentifier<T>identifier of the object to retrieve.

Returns

TypeDescription
T&T& Reference to the object with the given identifier.

Raises

TypeDescription
std::invalid_argumentif no object with the given identifier exists.

methgetOrThrowvirtualconst

const T& getOrThrow(Identifier<T> id) const

Get the object by its identifier or throw if missing.

Parameters

NameTypeDescription
idIdentifier<T>identifier of the object to retrieve.

Returns

TypeDescription
const T&const T& Const reference to the object with the given identifier.

Raises

TypeDescription
std::invalid_argumentif no object with the given identifier exists.

methforEachabstractconst

void forEach(std::function<bool(const T&)> func) const =0

Apply a function to each stored element.

Iterates over all stored elements and applies the provided function to them. The iteration continues until the function returns false or all elements have been processed.

Parameters

NameTypeDescription
funcstd::function<bool(const T&)>A callable object taking a const reference to an element and returning a boolean. Returning false stops the iteration.

classServer

Defined in <endstone/server.h>

Represents a server implementation.

Variables

NameDescription
BroadcastChannelAdminUsed for all administrative messages, such as an operator using a command.
BroadcastChannelUserUsed for all announcement messages, such as informing users that a player has joined.

Methods

NameDescription
Server
Server
operator=
~Server
getNameGets the name of this server implementation.
getVersionGets the version string of this server implementation.
getMinecraftVersionGets the Minecraft version that this server is running.
getProtocolVersionGets the network protocol version that this server supports.
getLoggerReturns the primary logger associated with this server instance.
getLanguageGets the current language interface used by the server.
getPluginManagerGets the plugin manager for interfacing with plugins.
getPluginCommandGets a PluginCommand with the given name or alias.
getCommandSenderGets a CommandSender for this server.
dispatchCommandDispatches a command on this server, and executes it if found.
getSchedulerGets the scheduler for managing scheduled events.
getLevelGets the server level.
getOnlinePlayersGets a list of all currently online players.
getMaxPlayersGet the maximum amount of players which can login to this server.
setMaxPlayersSet the maximum amount of players allowed to be logged in at once.
getPlayerGets the player with the given UUID.
getPortGet the game port that the server runs on.
getPortV6Get the game port (IPv6) that the server runs on.
getOnlineModeGets whether the Server is in online mode or not.
getPlayerGets the player with the exact given name, case-insensitive.
shutdownShutdowns the server, stopping everything.
reloadReloads the server configuration, functions, scripts and plugins.
reloadDataReload only the Minecraft data for the server.
broadcastBroadcasts the specified message to every user with the given permission name.
broadcastMessageBroadcasts the specified message to every user with permission endstone.broadcast.user.
broadcastMessage
isPrimaryThreadChecks the current thread against the expected primary server thread.
getItemFactory
getScoreboardGets the primary Scoreboard controlled by the server.
createScoreboardCreates a new Scoreboard to be tracked by the server.
getCurrentMillisecondsPerTickGets the current milliseconds per tick (MSPT).
getAverageMillisecondsPerTickGets the average milliseconds per tick (MSPT).
getCurrentTicksPerSecondGets the current ticks per second (TPS).
getAverageTicksPerSecondGets the average ticks per second (TPS).
getCurrentTickUsageGets the current tick usage of the server.
getAverageTickUsageGets the average tick usage of the server.
getStartTimeGets the start time of the server.
createBossBarCreates a boss bar instance to display to players. The progress defaults to 1.0.
createBossBarCreates a boss bar instance to display to players. The progress defaults to 1.0.
createBlockDataCreates a new BlockData instance for the specified block type, with all properties initialized to defaults.
createBlockDataCreates a new BlockData instance for the specified block type, with all properties initialized to defaults, except for those provided in data.
getBanList
getIpBanList
getServiceManager
_getRegistryReturns the registry for the given type.
getRegistry
getMapGets the map from the given item ID.
createMapCreate a new map with an automatically assigned ID.

varBroadcastChannelAdminstatic

const std::string BroadcastChannelAdmin

Used for all administrative messages, such as an operator using a command.

varBroadcastChannelUserstatic

const std::string BroadcastChannelUser

Used for all announcement messages, such as informing users that a player has joined.

methServer

Server() =default

methServer

Server(const Server&) =delete

methoperator=

Server& operator=(const Server&) =delete

meth~Servervirtual

~Server() =default

methgetNameabstractconst

std::string getName() const =0

Gets the name of this server implementation.

Returns

TypeDescription
std::stringname of this server implementation

methgetVersionabstractconst

std::string getVersion() const =0

Gets the version string of this server implementation.

Returns

TypeDescription
std::stringversion of this server implementation

methgetMinecraftVersionabstractconst

std::string getMinecraftVersion() const =0

Gets the Minecraft version that this server is running.

Returns

TypeDescription
std::stringversion of Minecraft

methgetProtocolVersionabstractconst

int getProtocolVersion() const =0

Gets the network protocol version that this server supports.

Returns

TypeDescription
intversion of network protocol

methgetLoggerabstractconst

Logger& getLogger() const =0

Returns the primary logger associated with this server instance.

Returns

TypeDescription
Logger&Logger associated with this server

methgetLanguageabstractconst

Language& getLanguage() const =0

Gets the current language interface used by the server.

Returns

TypeDescription
Language&Language interface used by the server for translations.

methgetPluginManagerabstractconst

PluginManager& getPluginManager() const =0

Gets the plugin manager for interfacing with plugins.

Returns

TypeDescription
PluginManager&a plugin manager for this Server instance

methgetPluginCommandabstractconst

PluginCommand* getPluginCommand(std::string name) const =0

Gets a PluginCommand with the given name or alias.

Parameters

NameTypeDescription
namestd::stringthe name of the command to retrieve

Returns

TypeDescription
PluginCommand*a plugin command if found, null otherwise

methgetCommandSenderabstractconst

ConsoleCommandSender& getCommandSender() const =0

Gets a CommandSender for this server.

Returns

TypeDescription
ConsoleCommandSender&a console command sender

methdispatchCommandabstractconst

bool dispatchCommand(CommandSender& sender, std::string command_line) const =0

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

Parameters

NameTypeDescription
senderCommandSender&the apparent sender of the command
command_linestd::stringthe command + arguments.

Returns

TypeDescription
booltrue if execution is successful, false otherwise

methgetSchedulerabstractconst

Scheduler& getScheduler() const =0

Gets the scheduler for managing scheduled events.

Returns

TypeDescription
Scheduler&a scheduling service for this server

methgetLevelabstractconst

Level* getLevel() const =0

Gets the server level.

Returns

TypeDescription
Level*the server level

methgetOnlinePlayersabstractconst

std::vector<Player*> getOnlinePlayers() const =0

Gets a list of all currently online players.

Returns

TypeDescription
std::vector<Player*>a list of currently online players.

methgetMaxPlayersabstractconst

int getMaxPlayers() const =0

Get the maximum amount of players which can login to this server.

Returns

TypeDescription
intthe amount of players this server allows

methsetMaxPlayersabstract

void setMaxPlayers(int max_players) =0

Set the maximum amount of players allowed to be logged in at once.

Parameters

NameTypeDescription
max_playersintThe maximum amount of concurrent players

methgetPlayerabstractconst

Player* getPlayer(endstone::UUID id) const =0

Gets the player with the given UUID.

Parameters

NameTypeDescription
idendstone::UUIDUUID of the player to retrieve

Returns

TypeDescription
Player*a player object if one was found, null otherwise

methgetPortabstractconst

int getPort() const =0

Get the game port that the server runs on.

Returns

TypeDescription
intthe port number of this server

methgetPortV6abstractconst

int getPortV6() const =0

Get the game port (IPv6) that the server runs on.

Returns

TypeDescription
intthe port number of this server

methgetOnlineModeabstractconst

bool getOnlineMode() const =0

Gets whether the Server is in online mode or not.

Returns

TypeDescription
booltrue if the server authenticates clients, false otherwise

methgetPlayerabstractconst

Player* getPlayer(std::string name) const =0

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

Parameters

NameTypeDescription
namestd::stringExact name of the player to retrieve

Returns

TypeDescription
Player*a player object if one was found, null otherwise

methshutdownabstract

void shutdown() =0

Shutdowns the server, stopping everything.

methreloadabstract

void reload() =0

Reloads the server configuration, functions, scripts and plugins.

methreloadDataabstract

void reloadData() =0

Reload only the Minecraft data for the server.

This includes functions and script files from all behaviour packs.

methbroadcastabstractconst

void broadcast(const Message& message, const std::string& permission) const =0

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

Parameters

NameTypeDescription
messageconst Message&message to broadcast
permissionconst std::string&the required permission Permissibles must have to receive the broadcast

methbroadcastMessageabstractconst

void broadcastMessage(const Message& message) const =0

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

Parameters

NameTypeDescription
messageconst Message&the message

methbroadcastMessageconst

void broadcastMessage(const std::format_string<Args...> format, Args&&... args) const

methisPrimaryThreadabstractconst

bool isPrimaryThread() const =0

Checks the current thread against the expected primary server thread.

Returns

TypeDescription
booltrue if the current thread matches the expected primary thread, false otherwise

methgetItemFactoryabstractconst

ItemFactory& getItemFactory() const =0

Gets the instance of the item factory (for ItemMeta).

See also

Returns

TypeDescription
ItemFactory&the item factory

methgetScoreboardabstractconst

Scoreboard* getScoreboard() const =0

Gets the primary Scoreboard controlled by the server.

This Scoreboard is saved by the server, is affected by the /scoreboard command, and is the scoreboard shown by default to players. This will only exist after the level has been loaded.

Returns

TypeDescription
Scoreboard*the default server scoreboard

methcreateScoreboardabstract

std::shared_ptr<Scoreboard> createScoreboard() =0

Creates a new Scoreboard to be tracked by the server.

This will not be saved by the server and is not affected by the /scoreboard command.

Returns

TypeDescription
std::shared_ptr<Scoreboard>the newly created Scoreboard

methgetCurrentMillisecondsPerTickabstract

float getCurrentMillisecondsPerTick() =0

Gets the current milliseconds per tick (MSPT).

Returns

TypeDescription
floatThe average current of milliseconds per tick.

methgetAverageMillisecondsPerTickabstract

float getAverageMillisecondsPerTick() =0

Gets the average milliseconds per tick (MSPT).

Returns

TypeDescription
floatThe average number of milliseconds per tick.

methgetCurrentTicksPerSecondabstract

float getCurrentTicksPerSecond() =0

Gets the current ticks per second (TPS).

Returns

TypeDescription
floatThe current ticks per second

methgetAverageTicksPerSecondabstract

float getAverageTicksPerSecond() =0

Gets the average ticks per second (TPS).

Returns

TypeDescription
floatThe average ticks per second

methgetCurrentTickUsageabstract

float getCurrentTickUsage() =0

Gets the current tick usage of the server.

Returns

TypeDescription
floatThe current tick usage in percentage.

methgetAverageTickUsageabstract

float getAverageTickUsage() =0

Gets the average tick usage of the server.

Returns

TypeDescription
floatThe average tick usage in percentage.

methgetStartTimeabstract

Gets the start time of the server.

Returns

TypeDescription
std::chrono::system_clock::time_pointThe start time of the server.

methcreateBossBarabstractconst

std::unique_ptr<BossBar> createBossBar(std::string title, BarColor color, BarStyle style) const =0

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

Parameters

NameTypeDescription
titlestd::stringthe title of the boss bar
colorBarColorthe color of the boss bar
styleBarStylethe style of the boss bar

Returns

TypeDescription
std::unique_ptr<BossBar>the created boss bar

methcreateBossBarabstractconst

std::unique_ptr<BossBar> createBossBar(std::string title, BarColor color, BarStyle style, std::vector<BarFlag> flags) const =0

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

Parameters

NameTypeDescription
titlestd::stringthe title of the boss bar
colorBarColorthe color of the boss bar
styleBarStylethe style of the boss bar
flagsstd::vector<BarFlag>a list of flags to set on the boss bar

Returns

TypeDescription
std::unique_ptr<BossBar>the created boss bar

methcreateBlockDataabstractconst

std::unique_ptr<BlockData> createBlockData(std::string type) const =0

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

Parameters

NameTypeDescription
typestd::stringthe block type

Returns

TypeDescription
std::unique_ptr<BlockData>new data instance

methcreateBlockDataabstractconst

std::unique_ptr<BlockData> createBlockData(std::string type, BlockStates block_states) const =0

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

Parameters

NameTypeDescription
typestd::stringthe block type
block_statesBlockStatesblock states, for example {"old_leaf_type":"birch", "persistent_bit":true}

Returns

TypeDescription
std::unique_ptr<BlockData>new data instance

methgetBanListabstractconst

PlayerBanList& getBanList() const =0

Gets the player ban list.

Returns

TypeDescription
PlayerBanList&The player ban list

methgetIpBanListabstractconst

IpBanList& getIpBanList() const =0

Gets the IP ban list.

Returns

TypeDescription
IpBanList&The IP ban list

methgetServiceManagerabstractconst

ServiceManager& getServiceManager() const =0

Gets the service manager.

Returns

TypeDescription
ServiceManager&The service manager

meth_getRegistryabstractconst

IRegistry* _getRegistry(const std::string& type) const =0

Returns the registry for the given type.

If no registry is present for the given type null will be returned.

Parameters

NameTypeDescription
typeconst std::string&of the registry to get

Returns

TypeDescription
IRegistry*the corresponding registry or null if not present

methgetRegistryconst

const Registry<T>& getRegistry() const

methgetMapabstractconst

MapView* getMap(std::int64_t id) const =0

Gets the map from the given item ID.

Parameters

NameTypeDescription
idstd::int64_tthe id of the map to get

Returns

TypeDescription
MapView*a map view if it exists, or null otherwise

methcreateMapabstractconst

MapView& createMap(const Dimension& dimension) const =0

Create a new map with an automatically assigned ID.

Parameters

NameTypeDescription
dimensionconst Dimension&the Dimension the map will belong to

Returns

TypeDescription
MapView&a newly created map view

classSkin

Defined in <endstone/skin.h>

Represents a player skin.

Methods

NameDescription
Skin
getIdGets the skin id.
getImageGets the skin image.
getCapeIdGets the cape id.
getCapeImageGets the cape image.

methSkin

Skin(std::string id, Image image, std::optional<std::string> cape_id = std::nullopt, std::optional<Image> cape_image = std::nullopt)

methgetIdconst

const std::string& getId() const

Gets the skin id.

Returns

TypeDescription
const std::string&the skin id.

methgetImageconst

const Image& getImage() const

Gets the skin image.

Returns

TypeDescription
const Image&the skin image.

methgetCapeIdconst

const std::optional<std::string>& getCapeId() const

Gets the cape id.

Returns

TypeDescription
const std::optional<std::string>&the cape id.

methgetCapeImageconst

const Image* getCapeImage() const

Gets the cape image.

Returns

TypeDescription
const Image*the cape image.

classType

Defined in <endstone/registry.h>

CRTP base for registry-backed types identified by an Identifier.

Provides getId(), getTranslationKey() pure virtual declarations, comparison operators, implicit conversion to Id, and a static get() method.

Type Aliases

NameDescription
Id

Methods

NameDescription
~Type
getIdReturn the identifier of this object.
getTranslationKeyGet the translation key, suitable for use in a translation component.
operator==
operator!=
operator==
operator!=
operator Id
getLook up a registry entry by identifier.

typeId

meth~Typevirtual

~Type() =default

methgetIdabstractconst

Id getId() const =0

Return the identifier of this object.

Returns

TypeDescription
Idthis object's identifier

methgetTranslationKeyabstractconst

std::string getTranslationKey() const =0

Get the translation key, suitable for use in a translation component.

Returns

TypeDescription
std::stringthe translation key

methoperator==const

bool operator==(const Id& other) const

methoperator!=const

bool operator!=(const Id& other) const

methoperator==const

bool operator==(const T& other) const

methoperator!=const

bool operator!=(const T& other) const

methoperator Idconst

operator Id() const

methgetstatic

const T* get(Id id)

Look up a registry entry by identifier.

Parameters

NameTypeDescription
idIdIdentifier to look up.

Returns

TypeDescription
const T*Pointer to the entry, or nullptr if not found.

structoverloaded

Defined in <endstone/variant.h>

Bases: Func...

Helper type for visitors.

enumGameMode

GameMode

Represents the various type of game modes that Players may have.

Values

NameValueDescription
Survival0Survival mode is the "normal" gameplay type, with no special features.
Creative1Creative mode may fly, build instantly, become invulnerable and create free items.
Adventure2Adventure mode cannot break blocks without the correct tools.
Spectator3Spectator mode cannot interact with the world in anyway and is invisible to normal players. This grants the player the ability to no-clip through the world.

typeMessage

funcoverloaded

overloaded(Func...) -> overloaded< Func... >

Deduction guide.

Parameters

NameTypeDescription
FuncTypes of function objects.

On this page

structColorFormatvarEscapevarBlackvarDarkBluevarDarkGreenvarDarkAquavarDarkRedvarDarkPurplevarGoldvarGrayvarDarkGrayvarBluevarGreenvarAquavarRedvarLightPurplevarYellowvarWhitevarMinecoinGoldvarMaterialQuartzvarMaterialIronvarMaterialNetheritevarMaterialRedstonevarMaterialCoppervarMaterialGoldvarMaterialEmeraldvarMaterialDiamondvarMaterialLapisvarMaterialAmethystvarMaterialResinvarObfuscatedvarBoldvarItalicvarResetclassIRegistrymeth~IRegistryclassIdentifiervarMinecraftmethIdentifiermethIdentifiermethIdentifiermethIdentifiermethgetNamespacemethgetKeymethoperator==methoperator!=methoperator std::stringmethminecraftclassLoggerenumLevelmethLoggermeth~LoggermethsetLevelmethisEnabledFormethgetNamemethlogmethlogmethtracemethtracemethdebugmethdebugmethinfomethinfomethwarningmethwarningmetherrormetherrormethcriticalmethcriticalclassOfflinePlayermeth~OfflinePlayermethgetNamemethgetUniqueIdclassPlayertypeFormVariantmethgetNamemethisOpmethsetOpmethgetXuidmethgetAddressmethtransfermethkickmethperformCommandmethisSneakingmethsetSneakingmethisSprintingmethsetSprintingmethplaySoundmethstopSoundmethstopAllSoundsmethgiveExpmethgiveExpLevelsmethgetExpProgressmethsetExpProgressmethgetExpLevelmethsetExpLevelmethgetTotalExpmethgetAllowFlightmethsetAllowFlightmethisFlyingmethsetFlyingmethgetFlySpeedmethsetFlySpeedmethgetWalkSpeedmethsetWalkSpeedmethgetScoreboardmethsetScoreboardmethsendPopupmethsendTipmethsendToastmethsendTitlemethsendTitlemethresetTitlemethspawnParticlemethspawnParticlemethspawnParticlemethspawnParticlemethgetPingmethgetLocalemethupdateCommandsmethgetInventorymethgetEnderChestmethgetGameModemethsetGameModemethgetDeviceOSmethgetDeviceIdmethgetGameVersionmethgetSkinmethsendFormmethcloseFormmethsendPacketmethsendMapclassPreconditionsmethcheckArgumentmethcheckStateclassRegistrymethgetmethgetmethgetOrThrowmethgetOrThrowmethforEachclassServervarBroadcastChannelAdminvarBroadcastChannelUsermethServermethServermethoperator=meth~ServermethgetNamemethgetVersionmethgetMinecraftVersionmethgetProtocolVersionmethgetLoggermethgetLanguagemethgetPluginManagermethgetPluginCommandmethgetCommandSendermethdispatchCommandmethgetSchedulermethgetLevelmethgetOnlinePlayersmethgetMaxPlayersmethsetMaxPlayersmethgetPlayermethgetPortmethgetPortV6methgetOnlineModemethgetPlayermethshutdownmethreloadmethreloadDatamethbroadcastmethbroadcastMessagemethbroadcastMessagemethisPrimaryThreadmethgetItemFactorymethgetScoreboardmethcreateScoreboardmethgetCurrentMillisecondsPerTickmethgetAverageMillisecondsPerTickmethgetCurrentTicksPerSecondmethgetAverageTicksPerSecondmethgetCurrentTickUsagemethgetAverageTickUsagemethgetStartTimemethcreateBossBarmethcreateBossBarmethcreateBlockDatamethcreateBlockDatamethgetBanListmethgetIpBanListmethgetServiceManagermeth_getRegistrymethgetRegistrymethgetMapmethcreateMapclassSkinmethSkinmethgetIdmethgetImagemethgetCapeIdmethgetCapeImageclassTypetypeIdmeth~TypemethgetIdmethgetTranslationKeymethoperator==methoperator!=methoperator==methoperator!=methoperator IdmethgetstructoverloadedenumGameModetypeMessagefuncoverloaded