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, and you can see them on the in-game Statistics screen.

Built-in stats ​

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

StatCountsTrains
Block Walked
Block Walked
block_walked
Walking, sprinting and crouching distance, in whole blocks
Walking Speed Experience Bottle
Water Walked/Swimmed
Water Walked/Swimmed
water_walked
Walking on water, walking under water and swimming distance, in whole blocks
Swim Speed Experience Bottle
Block Broken
Block Broken
block_broken
Every block brokenNone by default
Entity Killed
Entity Killed
entity_killed
Mob kills plus player kills
Strength Experience BottleEntity Reach Experience Bottle
Under Water Time (Ticks)
Under Water Time (Ticks)
under_water_time
Ticks spent with your head under water
Oxygen Experience Bottle
Fishing Time (Ticks)
Fishing Time (Ticks)
fishing_time
Ticks spent with a fishing line cast
Fishing Speed Experience Bottle
Items Fished
Items Fished
items_fished
Items reeled in
Fishing Luck Experience Bottle
Block Interacted (Place/Break)
Block Interacted (Place/Break)
block_interacted
Blocks broken plus blocks placedNone by default
Block Placed
Block Placed
block_placed
Every block placedNone by default
Ore Mined
Ore Mined
ore_mined
Ore blocks mined
Mining Luck Experience Bottle
Block Mined In Water
Block Mined In Water
block_mined_in_water
Blocks broken while in water
Submerged Breaking Speed Experience Bottle
Block Mined With Pickaxe
Block Mined With Pickaxe
block_mined_with_pickaxe
Blocks broken with a pickaxe that is the correct tool
Pickaxe Breaking Speed Experience Bottle
Block Mined With Shovel
Block Mined With Shovel
block_mined_with_shovel
Blocks broken with a shovel that is the correct tool
Shovel Breaking Speed Experience Bottle
Block Mined With Axe
Block Mined With Axe
block_mined_with_axe
Blocks broken with an axe that is the correct tool
Axe Breaking Speed Experience Bottle
Block Mined With Hoe
Block Mined With Hoe
block_mined_with_hoe
Blocks broken with a hoe that is the correct tool
Hoe Breaking Speed Experience Bottle
Block Mined When Floating
Block Mined When Floating
block_mined_when_floating
Blocks broken while not standing on the ground
Floating Breaking Speed Experience Bottle

Why pool at all?

Vanilla splits some actions across several statistics. Distance walked, sprinted and crouched are three separate counters, for example. Pooling them into a single block_walked stat means a skill can be driven by "moving on land" as a whole, rather than by 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 two:

  • Jumps minecraft:jump drives Jump
  • Damage Taken 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). The pooled block_walked and water_walked stats are already in whole blocks.
  • Damage is counted in tenths of a heart (10 = one full heart).
  • Time is counted in ticks (20 = one second).

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 can drive a skill: the minecraft:custom category, shown on the General tab of the Statistics screen. 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 one award per boundary crossed, stopping early if the skill hits its level cap. Even a large single jump in a stat, such as one big fall that deals a lot of damage at once, grants all the experience it should.

Released under the MIT License.