Files
anti-esp.sk
Code
1 50
anti-esp.sk
# DonutSMP-style mining pattern alerts.
# This is a heuristic only; review alerts before taking action.
options:
prefix: &8[&cAnti-ESP&8]&r
diamond-stone-threshold: 100
diamond-ore-threshold: 5
debris-stone-threshold: 150
debris-ore-threshold: 3
on join:
delete {antiesp::%uuid of player%::*}
on quit:
delete {antiesp::%uuid of player%::*}
on break:
if event-block is stone or deepslate:
add 1 to {antiesp::%uuid of player%::stone}
checkDiamondPattern(player)
if event-block is diamond ore or deepslate diamond ore:
add 1 to {antiesp::%uuid of player%::diamonds}
checkDiamondPattern(player)
if event-block is netherrack:
add 1 to {antiesp::%uuid of player%::netherrack}
checkDebrisPattern(player)
if event-block is ancient debris:
add 1 to {antiesp::%uuid of player%::debris}
checkDebrisPattern(player)
function checkDiamondPattern(p: player):
if {antiesp::%uuid of {_p}%::diamond-alerted} is not set:
if {antiesp::%uuid of {_p}%::stone} >= {@diamond-stone-threshold}:
if {antiesp::%uuid of {_p}%::diamonds} >= {@diamond-ore-threshold}:
set {antiesp::%uuid of {_p}%::diamond-alerted} to true
loop all players:
if loop-player has permission "antiesp.alerts":
send "{@prefix} &e%name of {_p}% &7mined &c%{antiesp::%uuid of {_p}%::diamonds}% diamonds &7among &f%{antiesp::%uuid of {_p}%::stone}% stone/deepslate blocks. &8(World: %world of {_p}%, X: %x-coordinate of {_p}%, Y: %y-coordinate of {_p}%, Z: %z-coordinate of {_p}%)" to loop-player
function checkDebrisPattern(p: player):
if {antiesp::%uuid of {_p}%::debris-alerted} is not set:
if {antiesp::%uuid of {_p}%::netherrack} >= {@debris-stone-threshold}:
if {antiesp::%uuid of {_p}%::debris} >= {@debris-ore-threshold}:
set {antiesp::%uuid of {_p}%::debris-alerted} to true
loop all players:
if loop-player has permission "antiesp.alerts":
send "{@prefix} &e%name of {_p}% &7mined &c%{antiesp::%uuid of {_p}%::debris}% ancient debris &7among &f%{antiesp::%uuid of {_p}%::netherrack}% netherrack blocks. &8(World: %world of {_p}%, X: %x-coordinate of {_p}%, Y: %y-coordinate of {_p}%, Z: %z-coordinate of {_p}%)" to loop-player