Grave inscriptions
When a player dies with a supported grave mod installed, Apoli asks every registered inscription provider for a line of text and stores the answers with the grave. Each supported mod then draws them on the gravestone. Origins uses this to show the origin the player had when they died.
| Grave mod | Where the lines appear |
|---|---|
| You're in Grave Danger | Under the owner's name, scaled to fit the stone. |
| Gravestones | The second sign line, joined with / when there is more than one. |
| GraveStone Mod | Under the owner's name. |
Registering a provider
import dev.overgrown.apoli.compat.grave.GraveInscriptions;
GraveInscriptions.register(MyMod.id("class"), player -> {
PlayerClass playerClass = PlayerClasses.of(player);
return playerClass == null ? null : playerClass.displayName();
});Register once, from your mod initialiser. The ID identifies your provider: registering the same ID again replaces it, and lines appear in registration order.
The provider runs on the server, once per death, while the grave is being made. Return a Component to add a line, or null to add nothing. A translatable component is stored as its key and translated on each viewer's client, so it follows their language.
The lines are saved with the grave, so they show what was true at the moment of death. Changing the player afterwards doesn't change graves they already have.
A provider that throws is logged and skipped, and it never stops the grave from being made.
What Origins registers
Origins registers origins:origin, one line with the name of the player's active origin on every enabled layer that isn't hidden, joined with /. A player with no origin gets no line.