Skip to content

Stats

A stat is the counter that drives a skill. Every skill names exactly one stat in its config; each time that stat advances by xpAwardActionCount, the skill awards xpPointToAward experience points. Stats are the same statistics Minecraft already tracks, so progress is saved with your world.

Built-in Stats

Experience Skills registers these custom stats (all under the experienceskills namespace). Several of them pool multiple vanilla statistics into one clean counter so a skill can react to a whole category of actions at once.

StatCountsPooled from
block_walkedBlocks travelled on footwalking + sprinting + crouching distance
water_walkedBlocks travelled through wateron-water + underwater + swimming distance
block_brokenBlocks mined
block_placedBlocks placed
block_interactedBlocks placed or brokenblock_broken + block_placed
entity_killedMobs and players killedmob kills + player kills
under_water_timeTicks spent underwater
fishing_timeTicks spent fishing
items_fishedItems reeled in

Why pool at all?

Vanilla splits some actions across several statistics — for example, distance walked, sprinted and crouched are three separate counters. Pooling them into a single block_walked stat means a skill can be driven by "moving on land" as a whole, rather than only one gait.

Using Vanilla Stats Directly

A skill's stat doesn't have to be one of the built-ins. Any vanilla custom statistic from the in-game Statistics screen works too. The built-in skills already use several:

  • minecraft:jump drives Jump
  • minecraft:damage_dealt drives Attack Damage
  • minecraft:damage_taken drives Vitality, Toughness and Block Reach

Mind the units

Vanilla stores some statistics in awkward units, and xpAwardActionCount is measured in those raw units:

  • Distances are counted in centimetres (100 = one block).
  • Damage is counted in tenths of a heart (10 = one full heart).

So a skill driven by minecraft:damage_dealt with xpAwardActionCount: 200 awards every 20 hearts of damage dealt.

What Counts as a Stat

Only custom statistics (the minecraft:custom category — the ones shown on the "General" tab of the Statistics screen) can drive a skill. Per-block and per-item statistics such as times mined diamond ore or times used a bucket cannot be referenced directly. To build a skill around those, pool the ones you care about into a custom stat — see Adding a Stat.

How Awards Fire

Whenever a player is awarded a stat, Experience Skills checks every skill whose stat matches. If the stat crossed one or more xpAwardActionCount boundaries since the last award, it grants a batch of experience — one award per boundary crossed — stopping early if the skill hits its level cap. This means even a large single jump in a stat (say, a big fall dealing lots of damage at once) correctly grants all the experience it should.

Released under the All Rights Reserved License.