Description
When a player mines or uncovers an ore specified in the plugin's configuration json, a detailed alert will be sent to online staff members and to the server's console.
View the attached video for a demonstration of this functionality.
Permissions
-
xray.alerts allows the player to see xray alerts
-
xray.bypass prevents the player from causing alerts
Configuration (xray-detection.json)
Code (Text):
{
"max-vein-iterations": 10,
"console-alerts": true,
"targets": [
"COAL_ORE",
"IRON_ORE",
"GOLD_ORE",
"REDSTONE_ORE",
"LAPIS_ORE",
"DIAMOND_ORE",
"EMERALD_ORE",
"ANCIENT_DEBRIS",
"DEEPSLATE_COAL_ORE",
"DEEPSLATE_IRON_ORE",
"DEEPSLATE_GOLD_ORE",
"DEEPSLATE_REDSTONE_ORE",
"DEEPSLATE_DIAMOND_ORE",
"DEEPSLATE_EMERALD_ORE",
"DEEPSLATE_LAPIS_ORE",
"NETHER_GOLD_ORE",
"NETHER_QUARTZ_ORE"
],
"alert-hover-message": "&aClick to teleport!",
"alert-click-command": "/tp [player]"
}
Theoretically, one can specify any material in the "targets" array to receive alerts for it (although I'm not sure why someone would want to do that). Since the plugin runs a loop on the main thread to count the size of veins, the "max-iterations" field ensures that this loop performs no more than the specified number of iterations. While this can be changed, the plugin will use min(30, max-iterations).
For no hover message or click command, remove the
alert-hover-message field or
alert-click-command field from your configuration respectively.
The rest of the fields specified above MUST be included in your configuration! Otherwise, NPEs are inevitable.
Bugs or Suggestions?
Feel free to message me on telegram at
freshlawn.
Enjoy.