Skip to main content

Tracking System

The tracking system is the shared backbone that feeds player activity data into both quest objectives and achievement triggers. It runs through a central TrackingService in the Core mod, which dispatches events to all registered listeners (Quest mod, Achievement mod, and any future modules).

Architecture

ECS Systems (Block Break, Kill, Damage, ...)
|
v
TrackingService (Core mod, central dispatcher)
|
+---> QuestTrackingListener (Quest mod)
+---> AchievementTrackingListener (Achievement mod)

All tracking events flow through the TrackingService. This ensures that a single block break or kill is counted for both quests and achievements without duplication.

Tracked Event Types

EventTrigger TypeDescription
Block broken (mined)blocks_minedStone, ores, and hard blocks
Block broken (chopped)blocks_choppedWood and tree blocks
Block broken (dug)blocks_dugDirt, sand, gravel, and soft blocks
Block placedblocks_placedAny block placed by a player
Block harvestedblocks_harvestedPlants picked with the interact key (F)
Flower pickedflowers_pickedFlower blocks specifically (subset of harvest)
Mob killedkillsAny mob or entity killed
Player killedplayer_killsPvP kills
Damage dealtdamage_dealtDamage done to mobs or players
Damage takendamage_takenDamage received from any source
Distance traveleddistance_walkedHorizontal movement in blocks
Playtimeplaytime_minutesMinutes spent online
Zone discoveredzones_discoveredNew map zones entered
Item crafteditems_craftedItems crafted at a workbench
Item collecteditems_collectedItems picked up or received
Chat messageschat_messagesMessages sent in chat
Equipmentfull_armor_set, equip_itemArmor sets and specific items equipped

Block Category Mapping

When a block is broken, the system categorizes it based on the block's group property. This determines which trigger type is fired.

Chopped (Wood)

Blocks in the Wood group are counted as chopped. This includes all tree trunks and wooden logs.

Dug (Soft Blocks)

Blocks in these groups are counted as dug:

Group
Dirt
Sand
Gravel
Mud
Soil
Snow
Grass
Moss
Cover

Mined (Hard Blocks)

Blocks in the Stone group or any group starting with Ore are counted as mined. Unknown solid blocks also fall into this category.

Excluded

The following groups are not tracked for break events:

GroupReason
PlantTracked separately via harvest
LeavesTracked separately via harvest
Fluid_WaterNot player-breakable
LavaNot player-breakable
PropsDecorative objects
AirNot a real block
tip

You can target specific blocks in quest objectives and achievement triggers by using the exact block ID (e.g. Ore_Gold) or by using the group: prefix (e.g. group:Wood to match all wood types).

Anti-Exploit: PlacedBlockTracker

The system includes built-in exploit prevention. When a player places a block and then breaks it, the break does not count toward quest or achievement progress.

SettingDefaultDescription
EnabledtrueWhether placed-block tracking is active.
Expiry30 minutesHow long a placed block is remembered. After this time, breaking it counts normally.

This prevents players from repeatedly placing and breaking blocks to farm progress. The tracker is shared between the Quest and Achievement mods.

info

The expiry timer means that blocks placed more than 30 minutes ago are treated as natural blocks again. This allows legitimate rebuilding to count after a reasonable delay.

Combat Tracking

Kills

Kill events include the victim type, which can be used for targeted triggers:

  • any_mob -- matches any non-player kill
  • any_player -- matches any PvP kill
  • Specific mob type (e.g. Spider, Snake_*) -- matches that mob type

Damage

Damage events track both dealt and received damage:

  • damage_dealt with target any, any_mob, any_player, or a specific mob type
  • damage_taken with cause fall, attack, fire, or any

Exploration Tracking

Zone discovery is tracked through two mechanisms:

  1. Zone polling -- Every 2 seconds, the system checks each player's current zone via the world map tracker. When the zone changes, a zone_discovered event is dispatched.
  2. Instance detection -- When a player enters an instance world (e.g. a dungeon), the zone name is extracted from the world name and dispatched automatically.

Each zone is only counted once per quest objective (deduplicated).

Playtime and Social Tracking

TrackerHow It Works
PlaytimeSession start time is recorded on connect. Minutes are calculated on disconnect and saved. Hourly checkpoints prevent data loss on crashes.
Chat messagesEach chat message increments the counter. Total count is used for achievement triggers.

Using Triggers in Achievements and Quests

Both achievements and quest objectives reference the same trigger types. Achievement triggers use count while quest objectives use amount:

Achievement trigger
{ "type": "blocks_mined", "target": "any", "count": 1000 }
{ "type": "kills", "target": "Spider", "count": 50 }
{ "type": "distance_walked", "target": "any", "count": 5000 }
{ "type": "flowers_picked", "target": "any", "count": 25 }
Quest objective
{ "type": "blocks_mined", "target": "Ore_Gold", "amount": 10 }
{ "type": "blocks_chopped", "target": "group:Wood", "amount": 50 }
{ "type": "kills", "target": "Bear_Grizzly", "amount": 3 }
{ "type": "items_crafted", "target": "Weapon_Sword_Iron", "amount": 1 }
info

The group: prefix in quest objectives allows matching all blocks in a group. For example, group:Wood matches Wood_Oak_Log, Wood_Birch_Log, and every other wood type.