Hey, lately i've been diving into anti-cheat dev.
I wouldn't say i'm good in it, but i might have an handy peace of code to detect nofall:
Hope this helps or is even usefull xD.
It was made with just simple thinking, you could modify the code to make it work better or fix some issues.
I wouldn't say i'm good in it, but i might have an handy peace of code to detect nofall:
Code:
@EventHandler
void onMove(PlayerMoveEvent e) {
Player p = e.getPlayer();
if(p.isOnGround() && inAir(e.getFrom(), e.getTo()) && p.getFallDistance() > 2.0D) {
//Using nofall or any other kind of ground spoofing
}
}
boolean inAir(Location from, Location to) {
double expand = 0.35;
for(double x = -expand; x < expand; x += expand) {
for(double z = -expand; z < expand; z += expand) {
if(from.add(x, from.getY() - 0.2D, z).clone().getBlock().getType() == Material.AIR) {
if(to.add(x, from.getY() - 0.2D, z).clone().getBlock().getType() == Material.AIR) {
return true;
}
}
}
}
return false;
}
Hope this helps or is even usefull xD.
It was made with just simple thinking, you could modify the code to make it work better or fix some issues.
Last edited: