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.11+

Endstone: >=0.11,<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.2.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.2.0
File Size Uploaded
endstone_papi-0.2.0.tar.gz 575.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for endstone-papi 0.2.0
File
endstone_papi-0.2.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details
endstone_papi-0.2.0-cp315-cp315-manylinux_2_31_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.31+ x86-64 Details
endstone_papi-0.2.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
endstone_papi-0.2.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.2.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
endstone_papi-0.2.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.2.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
endstone_papi-0.2.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.2.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
endstone_papi-0.2.0-cp311-cp311-manylinux_2_31_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.31+ x86-64 Details

Total release size: 14.0 MB

Release files / endstone_papi-0.2.0.tar.gz

Download URL endstone_papi-0.2.0.tar.gz
Size 575.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c661a7f3a864e636374e972d176e14bc62b38c6b840eeb83f1227856cd4c712c
BLAKE2b-256 checksum
How to use checksums
a8f2ce6f2f8bf57d1ad3d87a878cb293c13430778790ca334b55e51531677996
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 Oct 12, 2026.

Transparency log

Release files / endstone_papi-0.2.0-cp315-cp315-win_amd64.whl

Download URL endstone_papi-0.2.0-cp315-cp315-win_amd64.whl
Size 521.4 kB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
6b2ff47e9bccf0a6f7a447e794b083973a4324e4f2550a9745201241e29ee711
BLAKE2b-256 checksum
How to use checksums
29fcb40cafa5556bdd15062c361dbe45b1a819c789cd4ea580ff40c07fe24b16
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 Oct 12, 2026.

Transparency log

Release files / endstone_papi-0.2.0-cp315-cp315-manylinux_2_31_x86_64.whl

Download URL endstone_papi-0.2.0-cp315-cp315-manylinux_2_31_x86_64.whl
Size 2.2 MB
Tags CPython 3.15 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
6e98882c26ba289f8edf3abcc85892cd3453fa9f6a6c59ed69a5f8562a6f65b6
BLAKE2b-256 checksum
How to use checksums
f1eeb835b2f1e6e2d12f9a88b4b942e3bbb4e085135433d7ba9c452e9b51ea2b
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 Oct 12, 2026.

Transparency log

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

Download URL endstone_papi-0.2.0-cp314-cp314-win_amd64.whl
Size 521.4 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
7b7bf9d43206e1eec111ceea3c9224221fd24be0b2f21c644464db32166279bc
BLAKE2b-256 checksum
How to use checksums
b0b7ef995f6b4a57d5bfe74689237d348b296c168db694ba03ad9557dbd02d03
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 Oct 12, 2026.

Transparency log

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

Download URL endstone_papi-0.2.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
bbf22e622f8caa08714e81228c3528e8704c21c61647ff9b473c274d32ac612a
BLAKE2b-256 checksum
How to use checksums
885b6291bea01dba3705b4a1c3f38a98aa66a6b61d95dfe420f06fe43b5a28d6
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 Oct 12, 2026.

Transparency log

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

Download URL endstone_papi-0.2.0-cp313-cp313-win_amd64.whl
Size 503.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
3988387dcc8fc91c8a0db5724f08b7375e6b0cc416319d2e862295c3fdef0dff
BLAKE2b-256 checksum
How to use checksums
0d9b07cf5f8929b6866c381ad0649e75b77360dce0e2b7e2d2221a28dc16432c
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 Oct 12, 2026.

Transparency log

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

Download URL endstone_papi-0.2.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
5c9ee90a0d84c0da3a3cb9ce19d9c313fe180d55111e076549b05a804f3469b6
BLAKE2b-256 checksum
How to use checksums
8d41b7fb670b7eeaa92732a9a9071877425ee5d2232e3f7aeadc99148bf5231c
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 Oct 12, 2026.

Transparency log

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

Download URL endstone_papi-0.2.0-cp312-cp312-win_amd64.whl
Size 503.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
2edb4be23dee15fd36e382c01f54fa08dd41d89816fe0b7e87160b8a4048fa6b
BLAKE2b-256 checksum
How to use checksums
3434d577361bddc936f59178e2e4a01e5c4872c78e9b3fe43c15a01570165d9c
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 Oct 12, 2026.

Transparency log

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

Download URL endstone_papi-0.2.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
66cf0c93454932541296ce7a2c994884550a6fd82e332c606e0b443e4235b513
BLAKE2b-256 checksum
How to use checksums
257651646d0323a59c9e444a390100246db42d828353f937005821f7ddd113e9
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 Oct 12, 2026.

Transparency log

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

Download URL endstone_papi-0.2.0-cp311-cp311-win_amd64.whl
Size 502.4 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
dc4259c90d59982a36af061ae00aa4782fd233bf675ffeae1830781a0366bc19
BLAKE2b-256 checksum
How to use checksums
9dd0342910cfc30287b4ee4560a83ca5a11820a8160f5b4d6b7ff39925f3f8e9
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 Oct 12, 2026.

Transparency log

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

Download URL endstone_papi-0.2.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
24979e33c10c084bbfbcfa8b031d47c30e3fe0aa217c26ad78f679b934640d06
BLAKE2b-256 checksum
How to use checksums
ff50623b0536743b78854042d49955b394ed4346ec483fbb5b396d91149991ab
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 Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

11 release files

0.1.0

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