Applying a Stattrack
Applying initialises the counters for an itemβs group at 0 and appends the lore block. It costs money.
The apply flow
Section titled βThe apply flowβWhen a player runs /dstattrack add (or clicks Add in the GUI) while holding an item, dStattrack checks, in order:
- Holding an item? β empty hand β βYou must be holding an item to use stattrack!β
- Is it trackable? β the material must match
stattrackItems, otherwise βStattrack cannot be applied to<item>!β - Does it already have one? β βThis item already has a Stattrack!β
- Is economy available? β Vault + an economy plugin must be present, otherwise βEconomy (Vault) is not available.β
- Can they afford it? β needs at least the
price(default10,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.
Removing
Section titled βRemovingβ/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.
Setting an exact value
Section titled βSetting an exact valueβ/dstattrack set <category> <amount> overwrites a single counter β handy for migrating values or rewarding players:
/dstattrack set Playerkills 1000The 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.
Inspecting
Section titled βInspectingβ/dstattrack check prints the raw counters on the held item, e.g.:
This item has the following tags: Playerkills=12, Mobkills=240Permissions
Section titled βPermissionsβ| 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.