Skip to main content

PlaceholderAPI for Endstone

A PlaceholderAPI framework for Endstone, inspired by the PlaceholderAPI plugin for Spigot. C++ and Python plugins are equal providers: both implement the same expansion contract and share one registry, so a consumer never needs to know which language a placeholder came from.

Install

  • Download the official .whl from GitHub Releases
  • Put it in the plugins folder
  • Restart the server

Placeholder syntax

A placeholder is written {identifier:params}.

The first colon separates the identifier from the parameters. The identifier is ASCII-lowercased and matched case-insensitively; the parameters are passed to the expansion exactly as written, including underscores, dots, later colons, case, spaces, and an empty value.

Input Identifier Params Notes
{player:name} player name the ordinary form
{PLAYER:NaMe} player NaMe identifier lowercased, params preserved
{spark:cpu_process_1m} spark cpu_process_1m underscores belong to params
{player:} player (empty) dispatched with empty params
{player} — — no colon, so it stays literal

Anything that cannot be resolved is left exactly as written: malformed syntax, an unknown identifier, an expansion that returns no value, or an expansion exception. An empty string is a valid replacement. Replacement text is never re-scanned, so parsing is one-pass and nonrecursive.

{rel:identifier:params} is a separate, relational form handled only by setRelationalPlaceholders / set_relational_placeholders, and only by expansions that opt in to the relational callback. The rel: prefix selects relational parsing. The next colon separates the relational expansion identifier from its parameters; everything after that second colon is passed through unchanged. For example, {rel:friends:is_friend} dispatches identifier friends with params is_friend.

Identifiers must match [A-Za-z0-9][A-Za-z0-9-]*. Registration is case-insensitive, so identifiers that differ only by case collide. Dot, underscore, and colon are invalid in an identifier. rel is reserved by the relational syntax and cannot be registered as an expansion identifier.

The core provides no placeholders

PlaceholderAPI is a framework. It ships no built-in placeholders — no player name, coordinates, ping, time, or economy values. Every placeholder comes from an expansion registered by a plugin, which is what keeps ownership, permissions, and lifecycle with the plugin that understands the data.

Usage

C++

#include <endstone/endstone.hpp>
#include <endstone_papi/papi.h>

class NameExpansion final : public papi::PlaceholderExpansion {
public:
    [[nodiscard]] std::string getIdentifier() const override { return "player"; }
    [[nodiscard]] std::string getAuthor() const override { return "Endstone"; }
    [[nodiscard]] std::string getVersion() const override { return "1.0.0"; }

    [[nodiscard]] std::optional<std::string> onRequest(const endstone::OfflinePlayer *player,
                                                       std::string_view params) override
    {
        if (params != "name") {
            return std::nullopt;  // unresolved: the placeholder is left as written
        }
        return player ? player->getName() : std::string("nobody");
    }
};

// In onEnable:
auto api = getServer().getServiceManager().load<papi::PlaceholderAPI>(
    std::string(papi::PlaceholderAPI::ServiceName));
if (api && api->isActive()) {
    api->registerExpansion(*this, std::make_shared<NameExpansion>());
}

For the full code, see the C++ example plugin.

Python

from endstone.plugin import Plugin
from endstone_papi import PlaceholderAPI, PlaceholderExpansion


class NameExpansion(PlaceholderExpansion):
    identifier = "player"
    author = "Endstone"
    version = "1.0.0"

    def on_request(self, player, params):
        if params != "name":
            return None  # unresolved: the placeholder is left as written
        return player.name if player is not None else "nobody"


class MyPlugin(Plugin):
    api_version = "0.11"
    soft_depend = ["papi"]

    def on_enable(self):
        service = PlaceholderAPI.load(self.server.service_manager)
        if service is None or not service.active:
            return
        service.register_expansion(self, NameExpansion())

For the full code, see the Python example plugin.

Lifecycle

PAPI owns a registered expansion until it is unregistered, so a provider does not have to keep its own reference. Only the owner can explicitly unregister its expansions. PAPI also removes expansions when their owner or required plugin is disabled; calling unregister_expansions(self) from on_disable is allowed and simply makes that explicit.

A retained service reference stays safe after PAPI is disabled: it becomes permanently inert, so active turns False, parsing returns its input unchanged, queries come back empty, and mutations fail. After a reload, the old reference remains inert; consumers must load a fresh service.

Threading and introspection

Parsing and register/unregister mutations require the primary server thread, and provider callbacks execute there. containsPlaceholders / contains_placeholders, isActive / active, and copied registration metadata queries may be called from any thread. The introspection APIs are isRegistered, getRegisteredIdentifiers, and getExpansions in C++, and is_registered, registered_identifiers, and expansions in Python. The ordinary placeholder player may be null / None.

Commands

Command Description
/papi parse <text> Parse text using the sender when it is a player; otherwise use a null player
/papi parse <target> <text> Parse text for a player name, me, or --null target
/papi list List every registered identifier
/papi info <identifier> Show one expansion's metadata

All require the papi.command.papi permission, which defaults to operators. me is valid only for a player sender; invalid player names are rejected. Text may contain spaces, and selectors are not supported.

Requirements

Python: 3.10+

Endstone: >=0.11.8,<0.12 (API 0.11)

Platforms: x86-64 Windows and Linux.

Building from source

Requires CMake 3.29+, Ninja, Conan 2.30.0, and the Endstone toolchain: clang-cl 18+ with an x64 MSVC developer environment and Windows SDK on Windows, or Clang 18+ with libc++ and libc++abi on Linux. CI and release wheels use Clang 20.

python -m pip install "conan==2.30.0"
conan install . --build=missing
cmake --preset papi-dev
cmake --build --preset papi-dev
ctest --preset papi-dev --output-on-failure
python -m pytest -q
python -m pip install build
python -m build --wheel

Contributing

Contributions are welcome! Feel free to fork the repository, improve the code, and submit pull requests with your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

PlaceholderAPI for Spigot is GPL-licensed. This project is an independent implementation: its behavior was specified from observable inputs and outputs, and no source was copied or translated.

Metadata

Release files for endstone-papi 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for endstone-papi 0.1.0
File Size Uploaded
endstone_papi-0.1.0.tar.gz 575.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for endstone-papi 0.1.0
File
endstone_papi-0.1.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
endstone_papi-0.1.0-cp314-cp314-manylinux_2_31_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.31+ x86-64 Details
endstone_papi-0.1.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
endstone_papi-0.1.0-cp313-cp313-manylinux_2_31_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.31+ x86-64 Details
endstone_papi-0.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
endstone_papi-0.1.0-cp312-cp312-manylinux_2_31_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.31+ x86-64 Details
endstone_papi-0.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
endstone_papi-0.1.0-cp311-cp311-manylinux_2_31_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.31+ x86-64 Details
endstone_papi-0.1.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
endstone_papi-0.1.0-cp310-cp310-manylinux_2_31_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.31+ x86-64 Details

Total release size: 12.9 MB

Release files / endstone_papi-0.1.0.tar.gz

Download URL endstone_papi-0.1.0.tar.gz
Size 575.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4cea1ba470f7bfbd485958975fcd680fb588beddc16a48c5bfb46696c1a41afd
BLAKE2b-256 checksum
How to use checksums
25140c6e5bb1c95fad322f9ac014708bb9c1b85441688d5cf25df69512de9c59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp314-cp314-win_amd64.whl

Download URL endstone_papi-0.1.0-cp314-cp314-win_amd64.whl
Size 310.0 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
e5e68357233308e12865747197820a73b372bc3c81d3a176f9c7f6954bb09b7f
BLAKE2b-256 checksum
How to use checksums
33511bc1915132deb00ee1621ef763cd666882edaa738277c65b9c30309ba24c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp314-cp314-manylinux_2_31_x86_64.whl

Download URL endstone_papi-0.1.0-cp314-cp314-manylinux_2_31_x86_64.whl
Size 2.2 MB
Tags CPython 3.14 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
35150189b5a42810159ad0bb068e4a541dbe4342214c5ccb37edbac5d4dc4f9d
BLAKE2b-256 checksum
How to use checksums
0cbfd4d20f5d81aaf8a72313dad5a39de476a4cb99056dee2d4a4ea891b3034c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp313-cp313-win_amd64.whl

Download URL endstone_papi-0.1.0-cp313-cp313-win_amd64.whl
Size 298.8 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
fa846a9f0513913f33a089302a8b1dd7fd250b90c6e5356dc3cf8badbb5605e2
BLAKE2b-256 checksum
How to use checksums
800e9311496949266bb397f8c58ee1780708c9e42757633b0959083ad0d87626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp313-cp313-manylinux_2_31_x86_64.whl

Download URL endstone_papi-0.1.0-cp313-cp313-manylinux_2_31_x86_64.whl
Size 2.2 MB
Tags CPython 3.13 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
f692489f766776f0a5cf6014b98a19f1c221c8d93164874c37d11942f225af2c
BLAKE2b-256 checksum
How to use checksums
dde994be145f099befad9b0c098403642e9dd449cf23d96a2ce49e2a2239cb1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp312-cp312-win_amd64.whl

Download URL endstone_papi-0.1.0-cp312-cp312-win_amd64.whl
Size 298.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
bd2d2d85f23dd1ee22350886b7ac81210ba29ea85ad86564c014279657b121fd
BLAKE2b-256 checksum
How to use checksums
ad8a0f14a2842b10f751017916d2f75ba90857afa7a4136f4da8162bc97ebfaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp312-cp312-manylinux_2_31_x86_64.whl

Download URL endstone_papi-0.1.0-cp312-cp312-manylinux_2_31_x86_64.whl
Size 2.2 MB
Tags CPython 3.12 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
8b6cebb24195d644369f8a62ea5d26eaeb667d7239c83b0e6aaef6d268f41f7c
BLAKE2b-256 checksum
How to use checksums
a0454c6c929d794b0bc8d007dc0019bff73fc0e4a37295ed81601d4f620dc591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp311-cp311-win_amd64.whl

Download URL endstone_papi-0.1.0-cp311-cp311-win_amd64.whl
Size 298.0 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
1139ea45905cac8788ac484185ee7d1eaa9a224a886be141534fc81a39823de4
BLAKE2b-256 checksum
How to use checksums
aeff5668c29908b8ebb1dc48cbfdaf607baebc4876950df2ae35ffabf990d3a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp311-cp311-manylinux_2_31_x86_64.whl

Download URL endstone_papi-0.1.0-cp311-cp311-manylinux_2_31_x86_64.whl
Size 2.1 MB
Tags CPython 3.11 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
4d21feebaeb09ae5935596604ec6835b82f16d19f4bd8a0a43375c32aad7b953
BLAKE2b-256 checksum
How to use checksums
1cf2b77d02ad9300810a00586e2d9708b8ffc86c3eb211af3dce24a48395bbb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp310-cp310-win_amd64.whl

Download URL endstone_papi-0.1.0-cp310-cp310-win_amd64.whl
Size 295.7 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
6b0ac89ff1a8bb23b53fc6e6d384cd39dcbaf3f1d573bb332ee53af04ebf82bd
BLAKE2b-256 checksum
How to use checksums
ee6676287cb843c702a53a33f2232628bdc1aa8d6f4b30e2f58088e1ac3ec8df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / endstone_papi-0.1.0-cp310-cp310-manylinux_2_31_x86_64.whl

Download URL endstone_papi-0.1.0-cp310-cp310-manylinux_2_31_x86_64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
852285cc72491da305ac0424f5631d81d3ac538cb0d22885a8dce5abd3c2f0d3
BLAKE2b-256 checksum
How to use checksums
b55141a2e0c159a8a9297800917c79f5b815db4fa053fff54893f05d2c7f2930
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

11 release files

This release

0.1.0 This release

11 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page