### Example output of pip show Source: https://endstone.dev/stable/tutorials/create-your-first-plugin Expected output when checking the endstone package installation. ```text Name: endstone Version: 0.11.10 Summary: Endstone offers a plugin API for Bedrock Dedicated Servers, supporting both Python and C++. Home-page: Author: Author-email: Vincent Wu License: Apache License ``` -------------------------------- ### Install from source Source: https://endstone.dev/stable/getting-started/contributing?q= Install the package using pip or uv, optionally specifying a build directory for faster subsequent builds. ```bash pip install -U . # or with uv: uv pip install -U . ``` ```bash pip install -U . -C build-dir=./build ``` -------------------------------- ### Install Twine Source: https://endstone.dev/stable/tutorials/publish-your-plugin Install the Twine utility for publishing Python packages. ```bash pip install twine ``` -------------------------------- ### Perform an editable installation Source: https://endstone.dev/stable/tutorials/install-your-plugin Install the package in editable mode to allow live code changes without rebuilding. ```bash pip install --editable . ``` -------------------------------- ### Install project dependencies Source: https://endstone.dev/stable/getting-started/contributing?q= Install dependencies using Conan with missing packages built from source. ```bash conan install . --build=missing ``` -------------------------------- ### Check endstone installation Source: https://endstone.dev/stable/tutorials/create-your-first-plugin Verify the installation of the endstone package in the terminal. ```bash pip show endstone ``` -------------------------------- ### getStartTime Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server?q= Retrieves the server start time. ```APIDOC ### std::chrono::system_clock::time_point getStartTime() **Description:** Gets the start time of the server. **Returns:** The start time of the server. ``` -------------------------------- ### Install Conan package manager Source: https://endstone.dev/stable/getting-started/contributing?q= Install the required Conan package manager version 2.0 or higher. ```bash pip install conan ``` -------------------------------- ### Get starting enchantment level Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Enchantment Retrieves the minimum or starting level for this enchantment. ```cpp virtual int endstone::Enchantment::getStartLevel () const = 0 ``` -------------------------------- ### getStartLevel Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Enchantment Gets the level that this enchantment should start at. ```APIDOC ## int getStartLevel() ### Description Gets the level that this Enchantment should start at (also known as minimum level). ### Returns - **int** - Starting level of the Enchantment. ``` -------------------------------- ### Install Endstone via pip Source: https://endstone.dev/stable/getting-started/installation Installs the latest version of the Endstone Python package. ```bash pip install endstone ``` -------------------------------- ### getStartLevel Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Enchantment Retrieves the starting level for this enchantment. ```APIDOC ## int getStartLevel() ### Description Gets the level that this Enchantment should start at (also known as minimum level). ``` -------------------------------- ### Get All Plugins Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginManager Retrieves a list of all currently loaded plugins. ```cpp virtual std::vector< Plugin * > endstone::PluginManager::getPlugins () const = 0 ``` -------------------------------- ### Initialize Service Source: https://endstone.dev/stable/reference/python/plugin Create a new service instance. ```python Service() ``` -------------------------------- ### Get Teleport Locations Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1ActorTeleportEvent?q= Retrieves the starting or destination location of the teleportation event. ```cpp inline const Location & endstone::ActorTeleportEvent::getFrom () const ``` ```cpp inline const Location & endstone::ActorTeleportEvent::getTo () const ``` -------------------------------- ### Manage documentation Source: https://endstone.dev/stable/getting-started/contributing?q= Commands for installing documentation dependencies, serving a live preview, or building the static site. ```bash pip install -r docs/requirements.txt ``` ```bash mkdocs serve ``` ```bash mkdocs build ``` -------------------------------- ### Build the package Source: https://endstone.dev/stable/tutorials/publish-your-plugin Generate source distribution and wheel files in the dist/ directory. ```bash pipx run build ``` -------------------------------- ### Get Description Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Permission?q= Retrieves the brief description associated with the permission. ```cpp inline std::string endstone::Permission::getDescription () const ``` -------------------------------- ### Clone the repository Source: https://endstone.dev/stable/getting-started/contributing?q= Initial steps to download the project source code. ```bash git clone https://github.com/EndstoneMC/endstone.git cd endstone ``` -------------------------------- ### overloaded Deduction Guide Source: https://endstone.dev/stable/reference/cpp/namespaceendstone Deduction guide for function objects. ```cpp template endstone::overloaded ( Func... ) ``` -------------------------------- ### Initialize Command Source: https://endstone.dev/stable/reference/python/command Constructor for defining a new command with metadata. ```python Command( name: str, description: str | None = None, usages: list[str] | None = None, aliases: list[str] | None = None, permissions: list[str] | None = None, *args, **kwargs ) ``` -------------------------------- ### Command Constructor Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Command Initializes a new command instance with optional metadata. ```cpp inline explicit endstone::Command::Command ( std::string name, std::string description="", std::vector< std::string > usages={}, std::vector< std::string > aliases={}, std::vector< std::string > permissions={} ) ``` -------------------------------- ### Get Plugin Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginManager Retrieves a loaded plugin by its name. ```cpp virtual Plugin * endstone::PluginManager::getPlugin ( const std::string & name ) const = 0 ``` -------------------------------- ### Initialize permission Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Permission Initialize the permission with a plugin manager. ```cpp inline void endstone::Permission::init ( PluginManager & plugin_manager ) ``` -------------------------------- ### Initialize PluginCommand Source: https://endstone.dev/stable/reference/python/plugin?q= Constructor for creating a new PluginCommand instance with metadata and command configuration. ```python PluginCommand( name: str, description: str | None = None, usages: list[str] | None = None, aliases: list[str] | None = None, permissions: list[str] | None = None, *args, **kwargs ) ``` -------------------------------- ### getCommandSender Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server?q= Gets a CommandSender for this server. ```APIDOC ### ConsoleCommandSender & getCommandSender() Returns a console command sender. ``` -------------------------------- ### Bootstrap Endstone server Source: https://endstone.dev/stable/getting-started/start-your-server Run the endstone executable in the target directory to initialize the server. ```bash endstone ``` -------------------------------- ### getLevel Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets the server level. ```APIDOC ## Level* getLevel() ### Description Gets the server level. ### Returns - **Level*** - The server level. ``` -------------------------------- ### getLore Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1ItemMeta?q= Gets the lore that is set. ```APIDOC ### function getLore **Signature:** `virtual std::vector getLore() const = 0` **Description:** Gets the lore that is set. **Returns:** - `std::vector`: A list of lore that is set. ``` -------------------------------- ### Build with CMake Source: https://endstone.dev/stable/getting-started/contributing?q= Configure and build the project using CMake presets. ```bash cmake --preset conan-release cmake --build --preset conan-release ``` -------------------------------- ### getThrower Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Item Gets the thrower of the item. ```APIDOC ## std::optional getThrower() const ### Description Get the thrower of this item. ### Returns - **std::optional** - The unique ID of the thrower, if present. ``` -------------------------------- ### getServer Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1CommandSenderWrapper?q= Retrieves the server instance. ```APIDOC ### getServer() Returns the server instance that this command is running on. - **Returns** (Server&) - The server instance. ``` -------------------------------- ### getType Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Dimension Gets the type of this dimension. ```APIDOC ## Type getType() ### Description Returns the Type enum value representing the dimension type. ``` -------------------------------- ### Get Server State and Information Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server?q= Methods to retrieve server configuration, version, and level information. ```cpp virtual Level * endstone::Server::getLevel () const = 0 ``` ```cpp virtual int endstone::Server::getMaxPlayers () const = 0 ``` ```cpp virtual std::string endstone::Server::getMinecraftVersion () const = 0 ``` ```cpp virtual std::string endstone::Server::getName () const = 0 ``` ```cpp virtual bool endstone::Server::getOnlineMode () const = 0 ``` -------------------------------- ### getName Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Dimension Gets the name of this dimension. ```APIDOC ## std::string getName() ### Description Returns the name of the dimension. ``` -------------------------------- ### Build a Python plugin Source: https://endstone.dev/stable/tutorials/install-your-plugin Use pipx to build the plugin into a wheel package. ```bash pip install pipx pipx run build --wheel ``` -------------------------------- ### getLocation Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Block Gets the location of the block. ```APIDOC ## Location getLocation() const ### Description Gets the Location of the block. ``` -------------------------------- ### Get Server Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginLoader?q= Retrieves the Server object associated with the PluginLoader. ```cpp inline Server & endstone::PluginLoader::getServer () const ``` -------------------------------- ### Configure Plugin Entry Point Source: https://endstone.dev/stable/tutorials/create-your-first-plugin Define the plugin entry point in the project configuration using the module and class path. ```toml [project.entry-points."endstone"] my-plugin = "endstone_my_plugin:MyPlugin" ``` -------------------------------- ### getType Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Actor Get the type of the actor. ```APIDOC ## std::string getType() ### Description Returns the type of the actor as a string (e.g., minecraft:pig). ### Returns - **std::string** - The type of the actor. ``` -------------------------------- ### Get All Permissions Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginManager Retrieves a set of all registered permissions. ```cpp virtual std::unordered_set< Permission * > endstone::PluginManager::getPermissions () const = 0 ``` -------------------------------- ### Registry get method Source: https://endstone.dev/stable/reference/python/misc?q= Retrieves an object from the registry by its key. ```python get(key: str) -> _T | None ``` -------------------------------- ### Create a virtual environment Source: https://endstone.dev/stable/getting-started/installation Initializes a new isolated Python runtime environment. ```bash python3 -m venv venv ``` -------------------------------- ### asMob Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Actor Gets an Actor as a Mob. ```APIDOC ## Mob* asMob() ### Description Gets an Actor as a Mob. ### Returns - **Mob*** - The Mob object, or nullptr if the actor is not a Mob. ``` -------------------------------- ### Initialize Button Source: https://endstone.dev/stable/reference/python/form?q= Constructor for creating a button element. ```python Button( text: str | Translatable = "", icon: str | None = None, on_click: Callable[[Player], None] = None, ) ``` -------------------------------- ### asItem Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Actor Gets an Actor as an Item. ```APIDOC ## Item* asItem() ### Description Gets an Actor as an Item. ### Returns - **Item*** - The Item object, or nullptr if the actor is not an Item. ``` -------------------------------- ### Get Server instance Source: https://endstone.dev/stable/reference/cpp/namespaceendstone_1_1detail Retrieves the current Server singleton instance. ```cpp inline Server & endstone::detail::getServer () ``` -------------------------------- ### get Source: https://endstone.dev/stable/reference/cpp/service__manager_8h_source Retrieves a registered service by name. ```APIDOC ## std::shared_ptr get(std::string name) const ### Description Retrieves the service provider associated with the given name. ### Returns - **std::shared_ptr** - The service provider if found, otherwise null. ``` -------------------------------- ### Configure C++ CMake Project Source: https://endstone.dev/stable/tutorials/create-your-first-plugin Set up the CMakeLists.txt file to include the Endstone dependency and define the plugin target. ```cmake cmake_minimum_required(VERSION 3.15) project(my_plugin CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) include(FetchContent) FetchContent_Declare( endstone GIT_REPOSITORY https://github.com/EndstoneMC/endstone.git GIT_TAG v0.11 ) FetchContent_MakeAvailable(endstone) endstone_add_plugin(${PROJECT_NAME} src/my_plugin.cpp) ``` -------------------------------- ### getSkin Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player?q= Gets the player's skin. ```APIDOC ### Skin getSkin() const Returns the player's skin. ``` -------------------------------- ### getScoreboard Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player?q= Gets the Scoreboard displayed to this player. ```APIDOC ### Scoreboard & getScoreboard() const Returns the current scoreboard seen by this player. ``` -------------------------------- ### Initialize ActionForm Source: https://endstone.dev/stable/reference/python/form?q= Constructor for creating an ActionForm with optional callbacks and controls. ```python ActionForm( title: str | Translatable = "", content: str | Translatable = "", buttons: ( list[Button | Divider | Header | Label] | None ) = None, on_submit: Callable[[Player, int], None] = None, on_close: Callable[[Player], None] = None, ) ``` -------------------------------- ### Check CMake version Source: https://endstone.dev/stable/getting-started/contributing?q= Verify the installed version of CMake. ```bash $ cmake --version cmake version 3.31.2 ``` -------------------------------- ### Implement Command Handling in Python Source: https://endstone.dev/stable/tutorials/register-commands Defines a command and its permissions within a plugin class, implementing the on_command method to respond to the /hello command. ```python from endstone.command import Command, CommandSender from endstone.plugin import Plugin class MyPlugin(Plugin): api_version = "0.11" commands = { "hello": { "description": "Greet the command sender.", "usages": ["/hello"], "permissions": ["my_plugin.command.hello"], } } permissions = { "my_plugin.command.hello": { "description": "Allow users to use the /hello command.", "default": True, } } def on_command(self, sender: CommandSender, command: Command, args: list[str]) -> bool: if command.name == "hello": sender.send_message("Hello World!") return True # ... ``` -------------------------------- ### getName Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets the name of this server implementation. ```APIDOC ## std::string getName() ### Description Gets the name of this server implementation. ### Returns - **std::string** - Name of this server implementation. ``` -------------------------------- ### getItemFactory Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets the instance of the item factory. ```APIDOC ## ItemFactory& getItemFactory() ### Description Gets the instance of the item factory (for ItemMeta). ### Returns - **ItemFactory&** - The item factory. ``` -------------------------------- ### Construct a Permission object Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Permission Initialize a new permission with a name, description, default value, and optional children. ```cpp inline explicit endstone::Permission::Permission ( std::string name, std::string description="", PermissionDefault default_value=DefaultPermission, std::unordered_map< std::string, bool > children={} ) ``` -------------------------------- ### get Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Registry_1_1Type Looks up a registry entry by its identifier. ```APIDOC ## static const T* get(Id id) ### Description Look up a registry entry by identifier. ### Parameters - **id** (Id) - The identifier to look up. ### Returns - **const T*** - Pointer to the entry, or nullptr if not found. ``` -------------------------------- ### PluginCommand Constructor Source: https://endstone.dev/stable/reference/python/plugin?q= Initializes a new instance of a PluginCommand with the specified metadata and configuration. ```APIDOC ## PluginCommand(name, description=None, usages=None, aliases=None, permissions=None) ### Description Represents a command belonging to a plugin. This class is used to define command metadata and associate it with a command executor. ### Parameters - **name** (str) - Required - The name of the command. - **description** (str | None) - Optional - A brief description of the command. - **usages** (list[str] | None) - Optional - A list of usage strings for the command. - **aliases** (list[str] | None) - Optional - A list of alternative names for the command. - **permissions** (list[str] | None) - Optional - A list of permissions required to execute the command. ``` -------------------------------- ### Configure CMakeLists.txt Source: https://endstone.dev/stable/tutorials/create-your-first-plugin CMake configuration for a C++ Endstone plugin, including fetching the endstone dependency. ```cmake cmake_minimum_required(VERSION 3.15) project(my_plugin CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) include(FetchContent) FetchContent_Declare( endstone GIT_REPOSITORY https://github.com/EndstoneMC/endstone.git GIT_TAG v0.11 ) FetchContent_MakeAvailable(endstone) ``` -------------------------------- ### isSprinting Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player Gets whether the player is sprinting or not. ```APIDOC ### bool isSprinting() **Returns:** - (bool) true if player is sprinting. ``` -------------------------------- ### Get Server Instance Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Plugin?q= Returns the server instance that is currently executing the plugin. ```cpp inline Server & endstone::Plugin::getServer () const ``` -------------------------------- ### getInventory Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player Get the player's inventory. ```APIDOC ### PlayerInventory & getInventory() const Returns the inventory of the player, including armor slots. ``` -------------------------------- ### Get all pages Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1WritableBookMeta Retrieves a list containing all pages in the book. ```cpp virtual std::vector< std::string > endstone::WritableBookMeta::getPages () const = 0 ``` -------------------------------- ### PluginLoadOrder Enumeration Source: https://endstone.dev/stable/reference/python/plugin?q= Defines the initialization and enabling order for plugins during server startup. ```python POSTWORLD = 1 ``` ```python STARTUP = 0 ``` -------------------------------- ### getAddress Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player Gets the socket address of this player. ```APIDOC ### SocketAddress getAddress() const Returns the player's socket address. ``` -------------------------------- ### getPermissionLevel() Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Permissible?q= Gets the permission level of this object. ```APIDOC ## getPermissionLevel() ### Description Gets the permission level of this object. ### Returns - **PermissionLevel** - The permission level. ``` -------------------------------- ### ServerListPingEvent Constructor Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1ServerListPingEvent Initializes a new instance of the ServerListPingEvent class. ```cpp inline endstone::ServerListPingEvent::ServerListPingEvent ( SocketAddress address, std::string motd, int network_protocol_version, std::string minecraft_version_network, int num_players, int max_players, std::string server_guid, std::string level_name, GameMode game_mode, int local_port, int local_port_v6 ) ``` -------------------------------- ### get() Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1NotNull?q= Retrieves the underlying shared pointer. ```APIDOC ### Method: get() Returns a reference to the underlying shared pointer. #### Returns - **const pointer_type &** - The stored shared pointer. ``` -------------------------------- ### Initialize Dropdown Source: https://endstone.dev/stable/reference/python/form?q= Constructor for creating a dropdown element with predefined options. ```python Dropdown( label: str | Translatable = "", options: list[str] | None = None, default_index: int | None = None, ) ``` -------------------------------- ### getPickupDelay Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Item Gets the delay before the item can be picked up. ```APIDOC ## int getPickupDelay() const ### Description Gets the delay before this Item is available to be picked up by players. ### Returns - **int** - The delay in ticks. ``` -------------------------------- ### Get Placeholder Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1TextInput Retrieves the placeholder text for the input field. ```cpp inline Message endstone::TextInput::getPlaceholder () const ``` -------------------------------- ### Get Command Method Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1ServerCommandEvent Retrieves the command string currently being executed by the server. ```cpp inline std::string endstone::ServerCommandEvent::getCommand () const ``` -------------------------------- ### getLevel Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Dimension Gets the level to which this dimension belongs. ```APIDOC ## Level & getLevel() ### Description Returns the Level object associated with this dimension. ``` -------------------------------- ### Define a basic command Source: https://endstone.dev/stable/tutorials/register-commands Registers a simple command with a description and usage string. ```python from endstone.plugin import Plugin class MyPlugin(Plugin): api_version = "0.11" commands = { "hello": { "description": "Greet the command sender.", "usages": ["/hello"], } } # ... ``` ```cpp #include "my_plugin.h" ENDSTONE_PLUGIN("my_plugin", "0.1.0", MyPlugin) { description = "My first C++ plugin for Endstone servers"; command("hello") .description("Greet the command sender.") .usages("/hello"); } ``` -------------------------------- ### getType Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1BlockState?q= Gets the type of this block state. ```APIDOC ### virtual std::string getType() const = 0 Returns the string representation of the block type. ``` -------------------------------- ### Initialize Plugin Source: https://endstone.dev/stable/reference/python/plugin Base constructor for the Plugin class. ```python Plugin() ``` -------------------------------- ### getLocation Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1BlockState Gets the location of this block state. ```APIDOC ## Location getLocation() const ### Description Retrieves the world location of this block state. ### Returns - **Location** - The location of this block state. ``` -------------------------------- ### getLocation Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1BlockState?q= Gets the location of this block state. ```APIDOC ### virtual Location getLocation() const = 0 Returns the Location object representing the block's position. ``` -------------------------------- ### Constructing a Skin object Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Skin Initializes a new Skin instance with the required ID and image, and optional cape data. ```cpp inline endstone::Skin::Skin ( std::string id, Image image, std::optional< std::string > cape_id=std::nullopt, std::optional< Image > cape_image=std::nullopt ) ``` -------------------------------- ### Image Constructor (Data) Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Image Initializes an image using existing data. ```cpp template inline endstone::Image::Image ( Type type, int width, int height, const T & data ) ``` -------------------------------- ### getData Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1BlockState?q= Gets the data for this block state. ```APIDOC ### virtual std::unique_ptr getData() const = 0 Returns the BlockData associated with this state. ``` -------------------------------- ### Get Server Management Interfaces Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server?q= Methods to access ban lists, command senders, factories, and managers. ```cpp virtual PlayerBanList & endstone::Server::getBanList () const = 0 ``` ```cpp virtual ConsoleCommandSender & endstone::Server::getCommandSender () const = 0 ``` ```cpp virtual IpBanList & endstone::Server::getIpBanList () const = 0 ``` ```cpp virtual ItemFactory & endstone::Server::getItemFactory () const = 0 ``` ```cpp virtual Language & endstone::Server::getLanguage () const = 0 ``` ```cpp virtual Logger & endstone::Server::getLogger () const = 0 ``` ```cpp virtual PluginManager & endstone::Server::getPluginManager () const = 0 ``` -------------------------------- ### Get Location Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Block Retrieves the location of the block. ```cpp virtual Location endstone::Block::getLocation () const = 0 ``` -------------------------------- ### asPluginCommand Method Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginCommand Returns the object as a PluginCommand pointer. ```cpp inline virtual PluginCommand * endstone::PluginCommand::asPluginCommand () override const ``` -------------------------------- ### getDimension Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Block Gets the dimension which contains this block. ```APIDOC ## Dimension & getDimension() const ### Description Gets the dimension which contains this Block. ``` -------------------------------- ### Load multiple plugins Source: https://endstone.dev/stable/reference/python/plugin Load plugins from a directory or a list of file paths. ```python load_plugins(directory: str) -> list[Plugin] ``` ```python load_plugins(files: list[str]) -> list[Plugin] ``` -------------------------------- ### setFrom() Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PlayerMoveEvent?q= Sets the starting location for the move event. ```APIDOC ## void setFrom(const Location & from) ### Description Sets the location to mark as where the player moved from. ### Parameters - **from** (const Location &) - Required - New location to mark as the player's previous location. ``` -------------------------------- ### setFlying Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player Makes this player start or stop flying. ```APIDOC void setFlying(bool value) ``` -------------------------------- ### Enable All Plugins Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginManager Enables all currently loaded plugins. ```cpp virtual void endstone::PluginManager::enablePlugins () const = 0 ``` -------------------------------- ### Permission children property Source: https://endstone.dev/stable/reference/python/permissions?q= Gets the children of the permission. ```python children: dict[str, bool] ``` -------------------------------- ### Load plugin Source: https://endstone.dev/stable/reference/python/plugin Load a plugin from a specified file path. ```python load_plugin(file: str) -> Plugin ``` -------------------------------- ### Get Dimension Method Source: https://endstone.dev/stable/reference/python/level Retrieves a dimension by its name. ```python get_dimension(name: str) -> Dimension ``` -------------------------------- ### Permission Constructor Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Permission Creates a new Permission instance with a name, description, default value, and optional children. ```APIDOC ### Permission(std::string name, std::string description, PermissionDefault default_value, std::unordered_map children) Constructs a new Permission object. - **name** (std::string) - The unique name of the permission. - **description** (std::string) - A brief description of the permission. - **default_value** (PermissionDefault) - The default value for the permission. - **children** (std::unordered_map) - A map of child permissions. ``` -------------------------------- ### BlockType.get Source: https://endstone.dev/stable/reference/python/block?q= Attempts to get the BlockType with the given name. ```APIDOC ## BlockType.get ### Description Attempts to get the BlockType with the given name. ### Signature `get(name: str) -> BlockType` ### Parameters - **name** (str) - Required - The name of the block type to retrieve. ### Returns - **BlockType** - The requested BlockType instance. ``` -------------------------------- ### Image Constructor (Empty) Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Image Initializes an empty image with all pixels set to transparent black. ```cpp inline explicit endstone::Image::Image ( const Type type, const int width, const int height ) ``` -------------------------------- ### execute Method Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginCommand Executes the command with the provided sender and arguments, returning true on success. ```cpp inline virtual bool endstone::PluginCommand::execute ( CommandSender & sender, const std::vector< std::string > & args ) override const ``` -------------------------------- ### BlockState y property Source: https://endstone.dev/stable/reference/python/block?q= Gets the y-coordinate of this block state. ```python y: int ``` -------------------------------- ### Get Server Instance Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1CommandSender?q= Retrieves the server instance associated with the command sender. ```cpp virtual Server & endstone::CommandSender::getServer () const = 0 ``` -------------------------------- ### getTotalExp Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player?q= Gets the players total experience points. ```APIDOC ### int getTotalExp() const Returns the total amount of experience points collected over time. ``` -------------------------------- ### Server Attribute Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginLoader?q= Reference to the server instance. ```cpp Server& endstone::PluginLoader::server_; ``` -------------------------------- ### getPing Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player?q= Gets the player's average ping. ```APIDOC ### std::chrono::milliseconds getPing() const Returns the player's average ping. ``` -------------------------------- ### getLocale Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player?q= Gets the player's current locale. ```APIDOC ### std::string getLocale() const Returns the player's locale. ``` -------------------------------- ### Access JoinView begin iterator Source: https://endstone.dev/stable/reference/cpp/structendstone_1_1detail_1_1JoinView Represents the starting iterator of the range. ```cpp It endstone::detail::JoinView< It, Sentinel >::begin; ``` -------------------------------- ### PluginDescription Constructor Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginDescription Initializes a new instance of the PluginDescription class with the specified plugin metadata. ```APIDOC ## PluginDescription::PluginDescription ### Description Constructs a new PluginDescription object with the provided plugin details. ### Signature `PluginDescription(std::string name, std::string version, std::string description="", PluginLoadOrder load=PluginLoadOrder::PostWorld, std::vector authors={}, std::vector contributors={}, std::string website="", std::string prefix="", std::vector provides={}, std::vector depend={}, std::vector soft_depend={}, std::vector load_before={}, PermissionDefault default_permission=PermissionDefault::Operator, std::vector commands={}, std::vector permissions={})` ``` -------------------------------- ### getGameMode Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player?q= Gets this player's current GameMode. ```APIDOC ### GameMode getGameMode() const Returns the current game mode. ``` -------------------------------- ### Initialize Skin object Source: https://endstone.dev/stable/reference/python/player Constructor for defining a player skin with image data and optional cape information. ```python Skin( id: str, image: ndarray[uint8], cape_id: str | None = None, cape_image: ndarray[uint8] | None = None, ) ``` -------------------------------- ### getExpLevel Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player?q= Gets the players current experience level. ```APIDOC ### int getExpLevel() const Returns the current experience level. ``` -------------------------------- ### PluginLoader Constructor Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginLoader?q= Initializes a new PluginLoader instance with a reference to the server. ```cpp inline explicit endstone::PluginLoader::PluginLoader ( Server & server ) ``` -------------------------------- ### getEnderChest Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player?q= Get the player's EnderChest inventory. ```APIDOC ### Inventory & getEnderChest() const Returns the EnderChest of the player. ``` -------------------------------- ### Get Player Name Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player?q= Retrieves the name of the player. ```cpp virtual std::string endstone::Player::getName () override const = 0 ``` -------------------------------- ### Server Instance Retrieval Source: https://endstone.dev/stable/reference/cpp/detail_8h_source Retrieves the singleton Server instance by dynamically loading the runtime library and resolving the endstone_get_server symbol. ```cpp inline Server &getServer() { static Server *server; if (server == nullptr) { #ifdef _WIN32 auto handle = GetModuleHandleA("endstone_runtime.dll"); #else auto handle = dlopen("libendstone_runtime.so", RTLD_LAZY); #endif if (!handle) { throw std::runtime_error("Failed to load endstone runtime."); } using GetterFn = Server &(*)(); #ifdef _WIN32 auto fn = reinterpret_cast(GetProcAddress(handle, "endstone_get_server")); #else auto fn = reinterpret_cast(dlsym(handle, "endstone_get_server")); #endif if (!fn) { throw std::runtime_error("Failed to find symbol endstone_get_server"); } server = &fn(); if (!server) { throw std::runtime_error("Failed to get server instance."); } } return *server; } ``` -------------------------------- ### Get vector length Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Vector Calculates the magnitude of the vector. ```cpp inline float endstone::Vector::length () const ``` -------------------------------- ### Upload to PyPI Source: https://endstone.dev/stable/tutorials/publish-your-plugin Upload distributions to the official PyPI repository. ```bash twine upload -r pypi dist/* ``` -------------------------------- ### Get Midpoint Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Vector Calculates the midpoint between two vectors. ```cpp inline constexpr Vector endstone::Vector::getMidpoint ( const Vector & other ) const ``` -------------------------------- ### Define Command Parameters Source: https://endstone.dev/stable/tutorials/register-commands Use square brackets for optional parameters and angle brackets for mandatory parameters. ```text /hello [msg: message] ``` ```text /hello ``` -------------------------------- ### Get task ID Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Task Returns the taskId for the task. ```cpp virtual TaskId endstone::Task::getTaskId () const = 0 ``` -------------------------------- ### CommandSenderWrapper initialization Source: https://endstone.dev/stable/reference/python/command Constructor for a wrapper that forwards commands and captures output. ```python CommandSenderWrapper( sender: CommandSender, on_message: Callable[[str | Translatable], None] = None, on_error: Callable[[str | Translatable], None] = None, ) ``` -------------------------------- ### Get Plugin Description Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Plugin?q= Retrieves the metadata and details associated with the plugin. ```cpp virtual const PluginDescription & endstone::Plugin::getDescription () const = 0 ``` -------------------------------- ### getPluginManager Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets the plugin manager for interfacing with plugins. ```APIDOC ## PluginManager& getPluginManager() ### Description Gets the plugin manager for interfacing with plugins. ### Returns - **PluginManager&** - A plugin manager for this Server instance. ``` -------------------------------- ### getPluginCommand Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets a PluginCommand with the given name or alias. ```APIDOC ## PluginCommand* getPluginCommand(std::string name) ### Description Gets a PluginCommand with the given name or alias. ### Parameters - **name** (std::string) - Required - The name of the command to retrieve. ### Returns - **PluginCommand*** - A plugin command if found, null otherwise. ``` -------------------------------- ### Command Execution and Plugin Conversion Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Command?q= Methods for executing the command logic and checking if it is a plugin-specific command. ```cpp inline virtual PluginCommand * endstone::Command::asPluginCommand () const ``` ```cpp inline virtual bool endstone::Command::execute ( CommandSender & sender, const std::vector< std::string > & args ) const ``` -------------------------------- ### getServer Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1CommandSender?q= Retrieves the server instance associated with the command sender. ```APIDOC ### Server& getServer() const Returns the Server instance that this command is running on. ``` -------------------------------- ### getPlayer (UUID) Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets the player with the given UUID. ```APIDOC ## Player* getPlayer(endstone::UUID id) ### Description Gets the player with the given UUID. ### Parameters - **id** (endstone::UUID) - Required - UUID of the player to retrieve. ### Returns - **Player*** - A player object if one was found, null otherwise. ``` -------------------------------- ### getServer Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1CommandSender?q= Retrieves the server instance associated with the command sender. ```APIDOC ## virtual Server & getServer() const ### Description Returns the server instance that this command is running on. ### Returns - **Server&** - The server instance. ``` -------------------------------- ### getOnlinePlayers Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets a list of all currently online players. ```APIDOC ## std::vector getOnlinePlayers() ### Description Gets a list of all currently online players. ### Returns - **std::vector** - A list of currently online players. ``` -------------------------------- ### Define Plugin Metadata Source: https://endstone.dev/stable/tutorials/create-your-first-plugin Use the ENDSTONE_PLUGIN macro to specify the plugin name, version, and description. ```cpp #include "my_plugin.h" ENDSTONE_PLUGIN("my_plugin", "0.1.0", MyPlugin) { description = "My first C++ plugin for Endstone servers"; } ``` -------------------------------- ### getOnlineMode Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets whether the server is in online mode. ```APIDOC ## bool getOnlineMode() ### Description Gets whether the Server is in online mode or not. ### Returns - **bool** - True if the server authenticates clients, false otherwise. ``` -------------------------------- ### getMinecraftVersion Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets the Minecraft version that this server is running. ```APIDOC ## std::string getMinecraftVersion() ### Description Gets the Minecraft version that this server is running. ### Returns - **std::string** - Version of Minecraft. ``` -------------------------------- ### Construct a Vector with components Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Vector?q= Initializes a vector using provided X, Y, and Z components. ```cpp template T> inline constexpr endstone::Vector::Vector ( T x, T y, T z ) ``` -------------------------------- ### getMap Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets the map from the given item ID. ```APIDOC ## MapView* getMap(std::int64_t id) ### Description Gets the map from the given item ID. ### Parameters - **id** (std::int64_t) - Required - The id of the map to get. ### Returns - **MapView*** - A map view if it exists, or null otherwise. ``` -------------------------------- ### getCurrentTickUsage Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets the current tick usage of the server. ```APIDOC ## float getCurrentTickUsage() ### Description Gets the current tick usage of the server. ### Returns - **float** - The current tick usage in percentage. ``` -------------------------------- ### Get Player and Command Information Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server?q= Methods to retrieve player lists, specific players, and plugin commands. ```cpp virtual MapView * endstone::Server::getMap ( std::int64_t id ) const = 0 ``` ```cpp virtual std::vector< Player * > endstone::Server::getOnlinePlayers () const = 0 ``` ```cpp virtual Player * endstone::Server::getPlayer ( endstone::UUID id ) const = 0 ``` ```cpp virtual Player * endstone::Server::getPlayer ( std::string name ) const = 0 ``` ```cpp virtual PluginCommand * endstone::Server::getPluginCommand ( std::string name ) const = 0 ``` -------------------------------- ### getCommandSender Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Server Gets the console command sender for the server. ```APIDOC ## ConsoleCommandSender& getCommandSender() ### Description Gets a CommandSender for this server. ### Returns - **ConsoleCommandSender&** - A console command sender. ``` -------------------------------- ### initialize Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1MapRenderer Initializes the MapRenderer for a specific MapView. ```APIDOC ### initialize(MapView &map) Initializes this MapRenderer for the given map. #### Parameters - **map** (MapView&) - Required - The MapView being initialized. ``` -------------------------------- ### Initialize CommandSenderWrapper Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1CommandSenderWrapper Constructs a new wrapper instance with a sender and optional callbacks. ```cpp inline explicit endstone::CommandSenderWrapper::CommandSenderWrapper ( CommandSender & sender, Callback on_message={}, Callback on_error={} ) ``` -------------------------------- ### getCommand Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PlayerCommandEvent Retrieves the command string that the player is attempting to execute. ```APIDOC ### std::string getCommand() const Retrieves the command string that the player is attempting to send. **Returns:** - `std::string`: The command the player is attempting to send. ``` -------------------------------- ### Get Dropdown Options Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Dropdown Retrieves the list of available options for the dropdown. ```cpp inline std::vector< std::string > endstone::Dropdown::getOptions () const ``` -------------------------------- ### Get the scoreboard Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Score Retrieves the scoreboard associated with the objective. ```cpp virtual Scoreboard & endstone::Score::getScoreboard () const = 0 ``` -------------------------------- ### Get To Dimension Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PlayerDimensionChangeEvent Retrieves the dimension the player is entering. ```cpp inline Dimension & endstone::PlayerDimensionChangeEvent::getTo () const ``` -------------------------------- ### Set all pages Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1WritableBookMeta Clears existing pages and replaces them with the provided list. Limited to 50 pages with 798 characters per page. ```cpp template... Args> inline void endstone::WritableBookMeta::setPages ( Args &&... pages ) ``` ```cpp virtual void endstone::WritableBookMeta::setPages ( std::vector< std::string > pages ) = 0 ``` -------------------------------- ### Get From Dimension Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PlayerDimensionChangeEvent Retrieves the dimension the player is leaving. ```cpp inline Dimension & endstone::PlayerDimensionChangeEvent::getFrom () const ``` -------------------------------- ### Get Value Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PermissionAttachmentInfo?q= Retrieves the boolean value of the permission. ```cpp inline bool endstone::PermissionAttachmentInfo::getValue () const ``` -------------------------------- ### Configuring Form Properties Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1ActionForm Methods to set the content, controls, and submission callback for the form. ```cpp inline ActionForm & endstone::ActionForm::setContent ( Message text ) ``` ```cpp inline ActionForm & endstone::ActionForm::setControls ( const std::vector< Control > & controls ) ``` ```cpp inline ActionForm & endstone::ActionForm::setOnSubmit ( OnSubmitCallback on_submit ) ``` -------------------------------- ### Get Permission Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PermissionAttachmentInfo?q= Retrieves the name of the permission being set. ```cpp inline std::string endstone::PermissionAttachmentInfo::getPermission () const ``` -------------------------------- ### getDisplayName Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Objective?q= Gets the name displayed to players for this objective. ```APIDOC ### Method `std::string getDisplayName() const` ### Description Returns the display name of the objective. ``` -------------------------------- ### performCommand Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Player Makes the player perform the given command. ```APIDOC ### bool performCommand(std::string command) **Parameters:** - **command** (std::string) - The command to perform. **Returns:** - (bool) true if the command was successful, otherwise false. ``` -------------------------------- ### Getter Methods Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1ServerListPingEvent Methods to retrieve various server properties from the ping event. ```cpp inline SocketAddress endstone::ServerListPingEvent::getAddress () const ``` ```cpp inline GameMode endstone::ServerListPingEvent::getGameMode () const ``` ```cpp inline std::string endstone::ServerListPingEvent::getLevelName () const ``` ```cpp inline int endstone::ServerListPingEvent::getLocalPort () const ``` ```cpp inline int endstone::ServerListPingEvent::getLocalPortV6 () const ``` ```cpp inline int endstone::ServerListPingEvent::getMaxPlayers () const ``` ```cpp inline std::string endstone::ServerListPingEvent::getMinecraftVersionNetwork () const ``` ```cpp inline std::string endstone::ServerListPingEvent::getMotd () const ``` ```cpp inline int endstone::ServerListPingEvent::getNetworkProtocolVersion () const ``` ```cpp inline int endstone::ServerListPingEvent::getNumPlayers () const ``` ```cpp inline std::string endstone::ServerListPingEvent::getServerGuid () const ``` -------------------------------- ### getDisplayName Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1ItemMeta?q= Gets the display name that is set for the item. ```APIDOC ## std::string getDisplayName() ### Description Retrieves the display name currently set on the item metadata. ``` -------------------------------- ### getPlugin Method Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1PluginCommand Retrieves the plugin that owns this command. ```cpp inline Plugin & endstone::PluginCommand::getPlugin () const ``` -------------------------------- ### Get form title Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Form Retrieves the title of the form. ```cpp inline Message endstone::Form::getTitle () const ``` -------------------------------- ### getBlockAt Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Dimension Gets the block at the given coordinates or location. ```APIDOC ## std::unique_ptr< Block > getBlockAt(int x, int y, int z) ## std::unique_ptr< Block > getBlockAt(Location location) ### Description Gets the Block at the given coordinates or Location. ### Parameters - **x** (int) - X-coordinate of the block. - **y** (int) - Y-coordinate of the block. - **z** (int) - Z-coordinate of the block. - **location** (Location) - Location of the block. ### Returns - **std::unique_ptr< Block >** - The Block at the given coordinates. ``` -------------------------------- ### Load service Source: https://endstone.dev/stable/reference/python/plugin Retrieve a service by its name. ```python load(name: str) -> Service ``` -------------------------------- ### Get Dimension Type Source: https://endstone.dev/stable/reference/cpp/classendstone_1_1Dimension Retrieves the type of the dimension. ```cpp virtual Type endstone::Dimension::getType () const = 0 ```