What this does
The Kill-Replay placeholder API puts a clickable view-the-replay-of-that-kill button into your own death and kill messages. When a player dies, ReplayCore's death-cam registers a one-click link to re-watch that death; this article shows the three ways to surface that link in your own plugin or message.
Every lookup resolves the same record: the specific death the death-cam just offered. An expired session counts as no replay available, so a stale link is never shown, and when the player has no recent replay every lookup returns its empty value and no dead button is ever rendered.
Prerequisites
The death-cam must be enabled (it is on by default; see the configuration reference deathcam section). For the placeholder route, install PlaceholderAPI 2.11.0 or newer on the server. ReplayCore registers its expansion only when PlaceholderAPI is present; it is a soft dependency and never blocks ReplayCore from loading if it is absent.
Option 1: the PlaceholderAPI placeholders
ReplayCore registers the replaycore expansion, so each placeholder is written %replaycore_<name>%. The four kill-replay placeholders are: %replaycore_kill_replay% (the configured label, default [Click to view replay], or an empty string when there is no recent replay), %replaycore_kill_replay_link% (the browser death-cam URL, or empty), %replaycore_kill_replay_command% (the raw in-game relay command, or empty), and %replaycore_kill_replay_available% (true or false).
PlaceholderAPI returns plain text, so %replaycore_kill_replay% gives you the label only. To make it clickable on a network, use a message plugin that supports click actions: show %replaycore_kill_replay% as the visible text and use %replaycore_kill_replay_link% as an open-URL click action. That is the supported path. Downloads offers one ReplayCore JAR and does not offer a separate Velocity or BungeeCord proxy JAR. %replaycore_kill_replay_command% is only for a self-hosted in-game relay and is empty in cloud mode. When the player has no recent death-cam, the placeholders are empty and the line simply has no button.
death-message:
text: "&cYou were slain. %replaycore_kill_replay%"
click:
action: OPEN_URL
value: "%replaycore_kill_replay_link%"Configure the label
Open Configuration Studio's Messages section and customise the kill-replay label for the required scope and locale. Reset the override to inherit the workspace or category value; the shipped fallback is [Click to view replay].
Option 2: the ready-made clickable component
If your plugin builds messages with Adventure components, KillReplayMessage returns a fully wired clickable button (label, run-command, and hover) for a player's most recent replay, or an empty Optional when there is none to offer. The label is configurable; the click action and hover are fixed to the registry's current command, so you cannot accidentally wire the button to the wrong replay.
KillReplayApi api = resolveKillReplayApi(); // see Option 3
KillReplayMessage message = new KillReplayMessage(api, "[Click to view replay]");
Component deathLine = Component.text("You were slain by Steve.");
message.forPlayer(player.getUniqueId())
.ifPresent(button -> player.sendMessage(
deathLine.append(Component.space()).append(button)));Option 3: the Java service (KillReplayApi)
ReplayCore registers KillReplayApi as a Bukkit service, so a Java plugin can resolve a player's most recent death-cam link directly. latestKillReplay(UUID) returns an empty Optional when the player has no recent death-cam or the last one has expired. The call never blocks and never touches the recorder hot path; it reads an in-memory registry.
The KillReplay record it returns has three fields: replayId() (the UUID of the replay), command() (the ready-to-run watch command, including the leading slash), and expiresAtMillis() (epoch millis after which the watch token is no longer valid). It also exposes valid(long nowMillis), which reports whether the token is still valid at a given time.
RegisteredServiceProvider<KillReplayApi> rsp =
getServer().getServicesManager().getRegistration(KillReplayApi.class);
if (rsp != null) {
rsp.getProvider().latestKillReplay(playerId).ifPresent(replay -> {
// replay.replayId() -> the UUID of the replay
// replay.command() -> watch command (with a leading slash)
// replay.expiresAtMillis() -> epoch millis after which the token expires
player.performCommand(replay.command().substring(1)); // open the replay now
});
}Troubleshooting
If %replaycore_kill_replay% shows the literal text instead of a label, PlaceholderAPI is missing or below 2.11.0: install 2.11.0 or newer and restart. If the placeholder is always empty, the death-cam is disabled, the player has not died recently, or the last clip expired: confirm deathcam.enabled is true and have the player die in a tracked mode. If the button appears but the command fails on a network, wire the click to %replaycore_kill_replay_link% as an open-URL action. Do not look for a ReplayCore Velocity proxy JAR; Downloads does not offer one. If the KillReplayApi registration is null, the death-cam is disabled, so enable it; the API is wired alongside it.