Placeholders

Needs PlaceholderAPI installed. The identifier is corejobs.

Leaderboard placeholders are cached

Every top placeholder reads a cached copy, never the database, so putting them on a scoreboard for every player costs nothing extra. The copy is rebuilt every leaderboards.refresh-seconds, and a level up or a prestige brings the next rebuild forward to within leaderboards.min-delay-seconds.

The viewing player

Placeholder Returns
%corejobs_farmpoints% Current farmpoints balance
%corejobs_farmpoints_month% This month’s ranking points
%corejobs_farmpoints_last_month% Last month’s ranking points
%corejobs_overall_level% Every job level added up, prestiges included
%corejobs_prestiges% Total prestiges across all jobs

Per job

Replace <job> with a job id from jobs.yml.

Placeholder Returns
%corejobs_level_<job>% Current level
%corejobs_prestige_<job>% Prestige count
%corejobs_xp_<job>% XP into the current level
%corejobs_xpnext_<job>% XP needed for the next level, or MAX at the cap
%corejobs_pay_<job>% What the job pays right now, formatted

Example: %corejobs_level_miner%.

Boosts

<type> is xp, money or farmpoints. Nothing about the multiplier is fixed: whatever the boost was created with is what comes back, so the same placeholder reads x2, x3 or x4.

Placeholder Returns
%corejobs_boost_<type>_active% placeholder.active-yes or placeholder.active-no from your language file
%corejobs_boost_<type>_multiplier% The multiplier as a plain number, 2 or 3.5. 1 when none runs
%corejobs_boost_<type>_amount% The same with an x in front, x2. The placeholder.no-boost wording when none runs
%corejobs_boost_<type>_time% Time left as 1h 5m, or the placeholder.no-boost wording
%corejobs_boost_<type>_seconds% Time left as a plain number of seconds, 0 when none runs
%corejobs_boost_<type>_job% Which job it covers, or the boost.all-jobs wording
%corejobs_boost_<type>_type% The category name, for a label

Add a job id to ask about one job only: %corejobs_boost_xp_miner_time% only answers for boosts that cover the miner.

One line per category

A player can run one boost of each category at once, so %corejobs_boost_xp_amount% and %corejobs_boost_money_amount% can both be showing something at the same time.

&aXP: &f%corejobs_boost_xp_amount% &7%corejobs_boost_xp_time%
&6Money: &f%corejobs_boost_money_amount% &7%corejobs_boost_money_time%
&dPoints: &f%corejobs_boost_farmpoints_amount% &7%corejobs_boost_farmpoints_time%

Bonuses from other plugins

Another plugin can tell CoreJobs what it is adding on top, through the provider in the Developer API. A rank, an armour set or a pet reads through these.

Placeholder Returns
%corejobs_external_<type>_multiplier% What those plugins add up to on their own, 1 when none is registered
%corejobs_external_<type>_amount% The same with an x in front, x1.25
%corejobs_external_<type>_source% The plugin names giving more than 1.0, comma separated, or the placeholder.no-source wording
%corejobs_total_<type>_multiplier% The CoreJobs boost times all of them, which is what the player is really earning
%corejobs_total_<type>_amount% The same with an x in front
%corejobs_total_<type>_source% Everything giving more than 1.0, the CoreJobs boost first, then the plugins. The placeholder.no-source wording when nothing is

They take the same optional job id as the boost placeholders: %corejobs_total_xp_miner_amount%.

The boost_ placeholders are left alone by all this. One asks what boost the player bought, the other what they are earning.

Which source placeholder to use

external_..._source answers “which other plugins”, so a running CoreJobs boost is deliberately not in it. On a scoreboard that reads as “you have no boost” while the player has one, which is why total_..._source exists. Put total_ on a scoreboard, keep external_ for a line specifically about other plugins.

CoreJobs names its own boost with placeholder.self-source from your language file, so rename it to whatever your players see in the shop:

placeholder:
  self-source: "&bServer Boost"

With a x1.5 server boost and a x2.0 gear set running at once:

%corejobs_total_xp_multiplier%   ->  3
%corejobs_total_xp_source%       ->  Server Boost, zCustomGear
%corejobs_external_xp_source%    ->  zCustomGear
%corejobs_boost_xp_multiplier%   ->  1.5
One refresh behind at most

A provider is only ever asked on the main thread and the answer is cached, so a scoreboard thread costs nothing. boosts.external-refresh-ticks in config.yml sets how often the cached answers are refilled, and a placeholder nobody has asked for before reads 1 until the first refresh fills it.

Leaderboards

<n> is 1 up to leaderboards.size in config.yml.

Per job
Overall
Farmpoints
Monthly
%corejobs_top_<job>_<n>_name%
%corejobs_top_<job>_<n>_level%
%corejobs_top_<job>_<n>_prestige%

Sorted by prestige, then level.

%corejobs_topall_<n>_name%
%corejobs_topall_<n>_level%
%corejobs_topall_<n>_prestiges%
%corejobs_topfarmpoints_<n>_name%
%corejobs_topfarmpoints_<n>_points%

All-time balances.

%corejobs_topmonthly_<n>_name%
%corejobs_topmonthly_<n>_points%
%corejobs_toplastmonth_<n>_name%
%corejobs_toplastmonth_<n>_points%

This month and last month, so a board can carry both.

Empty slots

A leaderboard place nobody holds yet returns the placeholder.empty-name line from your language file for a name, and 0 for a number. Scoreboards never show a raw placeholder.

Placeholders inside CoreJobs text

It works the other way round too. With PlaceholderAPI installed, the job action bar (job.xp-actionbar in your language file) can carry another plugin’s placeholders, so a collection counter sits next to the job progress:

xp-actionbar: "{job} &7+{gained} xp &8({xp}/{xpnext}) &a+{money} &7{bar} &f{block} &8| &b%zcollections_total_progress%"

The action bar’s own tokens

Those {curly} names are CoreJobs’ own, not PlaceholderAPI’s, so they work with or without PlaceholderAPI installed. They are written once and filled per action, so you never define anything per block. The full list lives on the config page, and three of them matter here:

Token Fills with
{block} What just paid, written out. stone, oak log, zombie, cod
{block_id} The same thing as the raw key. stone, oak_log, zombie, cod
{job_id} The id of the job that paid. miner

The block a break started on, the mob killed, the item reeled in, or the item that went on the enchanting table, whichever of them paid.

Building another plugin’s placeholder out of them

CoreJobs fills its own tokens first and only hands the finished line to PlaceholderAPI afterwards. So {block_id} and {job_id} can sit inside another plugin’s placeholder and it will receive a real value:

xp-actionbar: "{job} &7+{gained} xp &f{block} &8| &b%someplugin_count_{block_id}%"

Use {block_id} for this, never {block}. {block} has spaces in it, and a placeholder identifier with a space in it does not resolve.

The other plugin still has to have that placeholder

This only builds the string. Whether it resolves is up to the other plugin. A counter that groups materials, where cobblestone counts toward a resource called stone, will not answer to cobblestone unless that plugin resolves the material for you. Check what it actually exposes before wiring it.

A collection counter that follows the block

zCollections 1.2.0 does resolve the material, so the whole line is one string that works for every block:

xp-actionbar: "{job} &7+{gained} xp &7{bar} &f{block} &8| &b%zcollections_block_{block_id}_name%&7: &f%zcollections_block_{block_id}_progress%&7/&f%zcollections_block_{block_id}_next%"

Breaking cobblestone reads Stone: 340/500, because it maps cobblestone to its stone resource itself. Swap block for entity on a mob job or fish on a fishing job. Nothing is configured per material.

A material no collection counts comes back empty, so the counter disappears on unrelated blocks. Any separator you typed between the placeholders stays, so keep the punctuation light or give the counter its own line.

Two plugins, one action bar

zCollections has an action bar of its own. If both are on, they write over each other. Turn progress-actionbar.enabled off in its config when the CoreJobs line is the one you want to see.

When it shows written out

A placeholder that reaches the player as %zcollections_total_progress% was never filled in. Run it through the check:

/corejobs papi %zcollections_total_progress%

It prints what you wrote, what PlaceholderAPI gave back, and whether the identifier in front of the first underscore is registered. Three outcomes:

  • PlaceholderAPI is not installed. Nothing fills in a %placeholder%, including CoreJobs’ own. The console names the affected lines on start.
  • The identifier is not registered. The plugin that owns it either has no PlaceholderAPI expansion or its expansion is not loaded. Install it from /papi ecloud or the plugin’s own page, then /papi reload.
  • The identifier is registered but the placeholder still comes back written out. The part after the identifier is not one that plugin provides, so check its spelling against that plugin’s own list.

A worked scoreboard

&aFarmpoints: &f%corejobs_farmpoints%
&aOverall level: &f%corejobs_overall_level%
&aMiner: &f%corejobs_level_miner% &7(p%corejobs_prestige_miner%)

&e#1 &f%corejobs_topmonthly_1_name% &7%corejobs_topmonthly_1_points%
&e#2 &f%corejobs_topmonthly_2_name% &7%corejobs_topmonthly_2_points%
Asking for more places than you keep

leaderboards.size caps the highest n. Asking for _11_ with a size of 10 returns the empty values, not an error.