Skip to content
Przejdź do treści
Mod na JavęLibraries & APIs

Text Placeholder API

autor: Patbox

Text Placeholder API lets Fabric mods share dynamic text data. It uses a simple %modid:type% format and includes a tool to style text without JSON. It runs on client and server.

Nasze streszczenie

Co robi ten projekt

What it does

Text Placeholder API is a library for Minecraft mods. It handles dynamic text. You can insert data from one mod into the text of another. It works with strings and Minecraft Text Components. The format is simple. You write %modid:type% or %modid:type data%. Older versions used a slash instead of a colon. The API parses these tags and replaces them with real values.

It also includes a text formatting tool. This tool lets you style text in configs or chat. You don't need to write JSON. Most players don't need external generators. Folks who try this just type the style commands. The API converts them to the correct format.

For users

You get better compatibility between mods. Many mods use this API. They share the same placeholder system. You can configure them in a similar way. Folks who try this can move information around. Folks who try this decide where the data shows up. The simplified text format makes styling easy. You can make text bold or colored. Folks who try this do this without learning complex code. But it saves time. What you get reduces errors in config files.

For developers

You save work on compatibility. Anyone don't need to write custom APIs for every other mod. Most players just use this one. It's small. You can include it in your mod jar. So this is called Jar-in-Jar. It keeps your mod size down. You can parse placeholders in any text. And this includes text from players. It includes text from config files. You can replace static or dynamic placeholders. This helps you build better user experiences. Admins and players can customize text easily.

Compatibility

It works on Fabric. What you get also works on Quilt. The result runs on the client. What you get runs on the server. You don't need it on both sides. So it is optional for both. Honestly, the license is LGPL v3.0. You can use it in your mods. Most players must follow the license terms.

The latest release is 3.1.0-beta.1+26.2. It supports Minecraft 26.2. That supports 26.2-pre-1. The previous release is 3.0.0+26.1. So it supports 26.1.2, 26.1.1, and 26.1. Older releases support 1.21.11 and 1.21.10. You can find the docs at placeholders.pb4.eu. The code is on GitHub. It's open source. You can see the changes. Most players can help with translations. There are files for Chinese, Spanish, Turkish, and Ukrainian.

Zgodność

Wersje i loadery

Zapisane wydania: 8

Zrzuty ekranu

Galeria

Text Placeholder API icon

Używamy plików cookie, aby poprawić Twoje wrażenia. Kontynuując korzystanie z tej witryny, wyrażasz zgodę na wykorzystywanie przez nas plików cookie. Przeczytaj naszą Politykę prywatności