About Placeholder API
This is a compact JAR-in-JAR embeddable API that enables creating and processing placeholders in strings and Minecraft text components. The mod uses a simple format of %modid:type% or %modid:type data% (in pre-1.19 versions — %modid:type/data%). Additionally, it includes simplified text markup that simplifies user input in configs, chats, etc.
For Players
The API allows flexible configuration of different mods in the same way while maintaining their cross-compatibility. Placeholders let you specify what information should be displayed and where in compatible mods. Simplified text markup also eliminates the need to write JSON manually or use special generators, allowing text styling in a readable format.
Usage videos:
- (YouTube links should be preserved here)
Usage example:
%my_mod:counter% - basic placeholder
The library already includes a set of prebuilt placeholders for everyday needs.
For Developers
Using Placeholder API is an easy way to achieve high mod compatibility with others without implementing separate APIs for each. Additionally, the placeholder processing system can be used for replacing static or dynamic fillers in texts created by players or read from configuration. Combined with Simplified Text Markup, this provides a first-class user and administrative experience.
Getting started with the API is very straightforward:
- Creating and adding placeholders is documented
- The literal parsing process is described step by step
- TextNodes and NodeParsers are available for fine-tuning Detailed documentation can be found on the project website
If your mod exposes API for passing GameProfile, then customizable placeholders will allow controlling the display of additional properties.