Catch x-ray miners
Score how suspicious a player's mining is and alert staff when it crosses a level.
ExyliaStaff watches how players find ore, not how much they mine. Somebody who walks straight at buried diamonds in the dark, seconds apart, gets a suspicion score from 0 to 100, and staff on every server are alerted when it crosses a level.
Before you start#
- Staff who receive alerts need
exyliastaff.mining.alerts. Staff who read records needexyliastaff.mining.view, andexyliastaff.mining.resetto wipe one. - The module switch is
modules.mininginplugins/ExyliaStaff/config.yml. Its settings live inplugins/ExyliaStaff/modules/mining/config.yml. - Optional: the Discord module posts each mining alert to the alerts webhook.
Steps#
Turn your alerts on
Run /mining. It toggles your alerts and tells you the new state; /mining on and /mining off set it. In the staff mode hotbar, right click the diamond pickaxe (slot 27, MINING) to do the same. /notifications and /xraynotify are aliases of /mining.
See who stands out
Run /mining top, or left click the pickaxe. The menu SUSPICIOUS MINERS lists the 45 highest scores, decayed to now, one head per player with their level and score. From the console the command prints the top ten as text.
Open a player's record
Click a head, or run /mining view <player> (works for offline players). The menu MINING shows one item per ore they mined. Teleport takes you to them (shift click goes on duty first), Reset wipes the record after a confirm screen, and Suspicious miners goes back.
Reset a record
Run /mining reset <player>. It only previews what would be erased; add confirm to do it: /mining reset <player> confirm. Staff with alerts on are told who reset it.
Check that it works#
In survival, dig a tunnel in the dark to a buried diamond vein, then another, a few seconds apart. Run /mining view <your name>: you should see your ores, and /mining top should list you with a level. When the score reaches a higher level than the last one announced, staff with alerts on get <player> level <level> » <score>/100 (<server>) with a sound that gets more urgent at each level.
Going further#
What counts as evidence#
Only ores of a family marked valuable feed the score; the rest count like stone. Of those, only the first block of a vein counts (a vein is up to vein.max-size connected blocks, 32 by default, remembered 30 minutes), and only a buried one: at most ore-exposure.partial-faces faces open to air, 1 by default. An ore on a cave wall is what a torch finds.
A block a player placed is ignored when broken for placed-blocks.remember-minutes (30). Creative breaks and breaks another plugin cancelled are ignored too.
Levels and when alerts go out#
The score never drops when a new reading is lower; it halves every decay-half-life-minutes (15), so a player who stops fades back to normal.
| Level | Score from |
|---|---|
| Warning | 16 |
| Suspicious | 26 |
| Very suspicious | 51 |
| Critical | 76 |
An alert goes out when a player climbs to a higher level than the last one announced, and again every alerts.interval-seconds (120) while they stay at suspicious or above. A warning is never repeated on the timer. Staff leaving staff mode have their alerts turned off.
Change the watched ores#
Each ore in ores has materials and valuable. By default diamond, emerald, ancient debris and gold are valuable; lapis, redstone, iron, copper and coal are tracked but not valuable. Add a block with the new ore's materials, then reload. A material the server does not know is skipped with one console warning.
Make it stricter or looser#
Each factor has enabled and its own thresholds and points, and levels holds the four score limits. factors.min-veins (3) is how many buried veins the ratio factors need before saying anything, so one lucky diamond is not a pattern. Reloading re-reads ores and thresholds; the vein and placed-block memories keep their minutes until a restart.
The nine factors
All of them read the last window-minutes (10) of breaks. The points of every factor that triggers are added, and the sum is capped at 100.
| Factor | Triggers when | Points |
|---|---|---|
| Frequency | 4, 8 or 13 buried veins in the window | 15, 30, 50 |
| Valuable ratio | More than 80 %, or 90 %, of broken blocks were buried valuable ore | 20, 35 |
| Straight line | The last 5 buried veins lie within 2 blocks of one line | 25 |
| Ambient light | 80 % of buried veins broken in darkness (light 0), or in dim light (up to 7) | 25, 12 |
| Deep mining | Below Y 16 and more than 60 % of the last 20 breaks were buried valuable ore | 15 |
| Discovery timing | 70 % of the gaps between veins were under 5 seconds | 25, 10 for moderate |
| Ore exposure | 70 % of fresh veins fully hidden, or partially | 25, 12 |
| Approach cost | 70 % of the gaps between veins were 8 blocks or fewer | 22, 10 for moderate |
| Beeline | 60 % of veins were walked at directly over the last 20 seconds, from 8 blocks or more | 25 |
Default modules/mining/config.yml keys, abridged:
window-minutes: 10
decay-half-life-minutes: 15.0
factors:
min-veins: 3
frequency: { enabled: true, suspicious: 4, very-suspicious: 8, critical: 13 }
straight-line: { enabled: true, block-count: 5, tolerance: 2.0, points: 25 }
deep-mining: { enabled: true, y-level: 16, ratio-percent: 60, points: 15 }
levels: { warning: 16, suspicious: 26, very-suspicious: 51, critical: 76 }
alerts:
interval-seconds: 120
critical:
sound: { name: BLOCK_NOTE_BLOCK_BELL, volume: 0.7, pitch: 0.8 }
vein: { max-size: 32, remember-minutes: 30 }
placed-blocks: { remember-minutes: 30 }Until 1.8.0 the critical alert played the ender dragon growl. A critical sound still exactly as shipped (ENTITY_ENDER_DRAGON_GROWL, pitch 1.8) moves to the note block bell on the first start; one you picked yourself stays.
Messages are in lang/<language>/modules/mining/messages.yml: alerts-on, alerts-off, alert, reset, reset-preview, confirm-reset, top-header, top-line, ore-line, and the five level names under levels. Colours and placeholders in them follow colours and messages.
The staff_mining table keeps one row per player: ore counts, the raw score with its timestamp, the level and the last alert. Dirty rows are written every thirty seconds, on quit and before the top list. The window, the trail and the last announced level live in memory only.
Commands and permissions#
| Command | What it does | Permission |
|---|---|---|
/mining | Turn your mining alerts on or off. | exyliastaff.mining.alerts |
/mining on | Receive mining alerts. | exyliastaff.mining.alerts |
/mining off | Stop receiving mining alerts. | exyliastaff.mining.alerts |
/mining top | Open the most suspicious miners. | exyliastaff.mining.view |
/mining view <player> | Open a player's mining record. | exyliastaff.mining.view |
/mining reset <player> [confirm] | Reset a player's mining record. Asks you to repeat with confirm. | exyliastaff.mining.reset |
| Permission | Who has it | What it allows |
|---|---|---|
exyliastaff.mining.alerts | Admins (op) | Be told about suspicious mining. |
exyliastaff.mining.view | Admins (op) | Look at a player's mining record. |
exyliastaff.mining.reset | Admins (op) | Reset a player's mining record. |
Placeholders#
These read the viewer's own record, which is what a staff sidebar wants. They need PlaceholderAPI.
| Placeholder | Shows | Example |
|---|---|---|
%exyliastaff_staff_mining_level% | Your own suspicion level name. | Normal |
%exyliastaff_staff_mining_score% | Your own suspicion score, decayed to now. | 0 |
%exyliastaff_staff_mining_alerts% | The mining alerts status text for you. | ON |
%exyliastaff_staff_mining_alerts_active% | true while you receive mining alerts. | true |
Something missing on this page? Tell us on Discord