Skip to content

Applying a Stattrack

Applying initialises the counters for an item’s group at 0 and appends the lore block. It costs money.

When a player runs /dstattrack add (or clicks Add in the GUI) while holding an item, dStattrack checks, in order:

  1. Holding an item? β€” empty hand β†’ β€œYou must be holding an item to use stattrack!”
  2. Is it trackable? β€” the material must match stattrackItems, otherwise β€œStattrack cannot be applied to <item>!”
  3. Does it already have one? β€” β€œThis item already has a Stattrack!”
  4. Is economy available? β€” Vault + an economy plugin must be present, otherwise β€œEconomy (Vault) is not available.”
  5. Can they afford it? β€” needs at least the price (default 10,000), otherwise β€œYou do not have enough money … missing <amount>.”

If every check passes, the price is withdrawn via Vault, the group’s counters are created at 0, and the lore block is added. The player hears the success sound.

/dstattrack remove (or double-click Remove in the GUI) strips the plugin’s lore block and deletes all of its NBT tags from the held item. Removing does not refund the price.

/dstattrack set <category> <amount> overwrites a single counter β€” handy for migrating values or rewarding players:

/dstattrack set Playerkills 1000

The category must belong to the held item’s group, otherwise β€œThis category does not exist for this item.” Run /dstattrack info to list valid categories.

/dstattrack check prints the raw counters on the held item, e.g.:

This item has the following tags: Playerkills=12, Mobkills=240
Action Permission
Apply dstattrack.add
Remove dstattrack.remove
Set a value dstattrack.set
Inspect tags dstattrack.check
List categories dstattrack.info

See Commands & Permissions for defaults.