Skip to content

Placeholders EN

sqkl520 edited this page Nov 28, 2026 · 4 revisions

Placeholders

简体中文 | English

With PlaceholderAPI installed, this plugin registers a lle expansion so scoreboards, tab lists, and holograms can display learning data. Run /papi list and confirm lle is listed — that means it is connected.

Full placeholder list

Learning stats

Placeholder Returns Example
%lle_score% Total learning score 12480
%lle_words% Words learned (same value as %lle_correct%) 1032
%lle_accuracy% Accuracy, with percent sign 85.3%
%lle_accuracy_raw% Accuracy, bare number 85.3
%lle_sessions% Total learning sessions 42
%lle_correct% Total correct answers 1032
%lle_incorrect% Total incorrect answers 178

Rank and achievements

Placeholder Returns Example
%lle_rank% Overall rank #7 / Unranked
%lle_achievements% Achievement progress 3/22
%lle_achievements_raw% Unlocked count, bare number 3
%lle_achievement_<id>% Single achievement state ✓ / ✗

<id> comes from the Achievement enum's id — 22 in total: first_word words_25 words_100 words_500 perfect_session spelling_master streak_3 streak_10 daily_streak_3 daily_streak_7 sessions_10 sessions_50 coins_500 coins_5000 ai_chat_10 ai_chat_50 review_streak_7 wrong_book_cleared accuracy_90 duel_first_win helpful study_days_30. For example %lle_achievement_first_word%. Unknown ids return null, letting other expansions handle them.

Streaks and coins

Placeholder Returns Example
%lle_streak% Current daily check-in streak 12
%lle_longest_streak% Peak answer combo 25
%lle_coins_earned% Lifetime coins earned 3200

streak is the check-in streak; longest_streak is the answer combo streak. They are not the same thing.

Seasons

Placeholder Returns When seasons are off
%lle_season% Current season number empty string
%lle_season_days_left% Days remaining empty string
%lle_season_rank% Season rank empty string

Duels and review

Placeholder Returns Notes
%lle_duel_wins% Duel wins Empty string on first read; filled in once loaded
%lle_review_due% Words due for review Bare integer; empty while unknown — see below

For third-party plugins doing numeric comparison

Plugins like AJLeaderboards / Autorank / ConditionalEvents need a number that parses; placeholders carrying symbols fail:

Placeholder Returns parseDouble / parseInt
%lle_accuracy% 85.3% ✗ fails
%lle_accuracy_raw% 85.3 ✓ works
%lle_achievements% 3/22 ✗ fails
%lle_achievements_raw% 3 ✓ works

For leaderboards or conditions, always use the _raw variant.

What an empty string means

An empty string means "not known yet", not "none". On a scoreboard it is simply an empty slot that fills in on the next refresh; the plugin never substitutes a fake number, because "unknown" and "rank 0" are two different things.

Situation Returns
Unknown placeholder name null (PAPI convention — lets other expansions try)
Player data not loaded yet 0
Rank / coins read failed empty string (never fabricates a number); retried next round
Duel wins read failed 0, cached for 30 seconds (known source-level issue — see below)
streak / longest_streak database error 0

What %lle_review_due% returns, and its limits

The number of words due for review, as a bare integer (for example 7). 0 means "checked, and nothing is due right now" — a confirmed result. An empty string means "unknown", which happens in three cases: the player UUID is missing, this session's progress read failed, or the player's review data is not in memory (offline, or never loaded).

The value reads memory only and never queries the database, so refreshing it on a scoreboard causes no tick stalls.

With several sub-servers sharing one MySQL database, this number has no reliable upper bound. Reviews on another server never flow back into this server's memory, and loading a player only fills in words that are missing rather than overwriting existing ones — so not even a reload refreshes the old timestamps. It converges only when that player rejoins. Until then the number can be too high (words another server just reviewed still count as due here) or too low (words learned elsewhere are not known here yet). On a single server it is accurate immediately.

It is gated by showResults: when someone else views a player who has turned off "show results", they get the privacy placeholder instead of the real count. The number reveals how many words a player has learned and how far along they are, which puts it in the same family as words.

Privacy rules

Players can turn off two switches in their profile; when off, the placeholders others see are masked. Viewing as yourself through the relational entry is unaffected (the exception for the plain entry is described below).

Switch Effect when off
Show in square (showInSquare) Every placeholder read by others becomes a privacy placeholder (rank / season_rank are exceptions and show "Unranked"; season / season_days_left are server-level state and unaffected)
Show results (showResults) The results family read by others (score / words / accuracy / sessions / correct / incorrect / achievements / longest_streak / duel_wins / review_due, achievement_<id>, and the _raw aliases) becomes a privacy placeholder

%lle_streak% is deliberately not in the results family: it measures "did you show up each day" and reveals nothing about right or wrong answers.

%lle_coins_earned% has a third gate: it is shown to the owner only. When anyone else reads it — regardless of the two switches — it always returns the privacy placeholder.

Who "self" is on a scoreboard

Plain %lle_*% cannot see the viewer's identity — PAPI only passes back the target player — so the plugin always treats it as "not self" (fail-closed). This means a player's own scoreboard %lle_score% is masked by their own privacy switch, and %lle_coins_earned% always shows the privacy placeholder for them.

To let players see their own real data, use the relational entry %rel_lle_<params>% — it receives the real viewer identity and only counts as self when viewer == target. "View someone else" features should use the same entry so the privacy gates are applied correctly.

Performance

Caching

Placeholder results are cached for 30 seconds per (player, parameter, perspective, language). High-frequency scoreboard refreshes will not repeatedly hit the database. Coins do not use this layer; they cache for 60 seconds themselves (see the next section).

Async backfill for rank and coins

%lle_rank% and %lle_coins_earned% sit on top of database queries (rank is an O(players) count query — measured at 2.5 seconds with 50,000 players), so the value itself uses async backfill: return on a hit, return an empty string on a miss, and fill it in once the background read returns.

Note that "the calling thread never touches the database" only holds for the value lookup, not the whole chain. Every resolution first reads the target's privacy setting via loadProfileSettingsForDisplay, that cache necessarily misses for offline players, and a miss runs a synchronous SELECT of one row from player_profiles without writing the cache. So placeholders for an offline target still cost one main-thread query per refresh. coins_earned is not in the outer 30-second cache, so it takes this path every time.

Rank uses stale-while-revalidate when a value exists but has expired: it returns the old value and refreshes in the background. Coins has no such step — an expired value immediately returns an empty string. Rank has it because its query is slow and a blank cell every 30 seconds is a visible fault for players; coins is an ordinary single-column query, where one blank cell is acceptable.

So the rank cell is blank on first load and fills in a few seconds later. That is by design, not a bug.

An earlier version had a defect where rank went blank every 30 seconds like clockwork. Returning the stale value instead of an empty string fixed it.

Connecting high-refresh plugins like TAB

TAB refreshes placeholders every 500 ms by default. A 20-player tab list means 40 parses per second, all on the main thread.

The plugin's caching keeps database pressure off, but refreshing learning data every 500 ms is pointless (the data changes slowly). Raise the refresh interval for lle placeholders:

# TAB's config.yml
placeholder-refresh-intervals:
  default-refresh-interval: 500
  "%lle_score%": 5000
  "%lle_rank%": 5000
  "%lle_words%": 5000

See Integrations for details.

Failure behaviour

Situation Returns
Unknown placeholder name null (PAPI convention — lets other expansions try)
Player data not loaded yet 0
Rank / coins read failed empty string, retried next round
Duel wins read failed 0, cached for 30 seconds

The last row is a known source-level defect: getDuelStats returns (0, 0) in its SQLException branch without throwing, so a failed query and "genuinely zero wins" are indistinguishable from the return value. The error direction is "shows 0 instead of an empty string" — it cannot cause a wrong reward payout, but the number is not trustworthy.

Outside that one case it never returns a fake number. A failed rank read returns an empty string, for example, not #0 — "unknown" and "rank 0" are two different things.

Clone this wiki locally