I would like to point out the fact that packets sent because of "setVelocity()" will have no effects whatsoever on hacked clients that have antiknockback, like nothing happened (tested with Wurst).
And some plugins such as NCP have no "antiknockback" check.
Maybe add warning about this or something... there isn't much that can be done about this, except maybe check if player really moved etc but that would prob. be too expensive (PlayerMoveEvent or task every few ticks).
I could teleport them if they get too far in (like how teleport mode does) :smile:
This would require calculating distance and whatnot, but it should work well.
https://github.com/TechzoneMC/SpawnShield/blob/3e9a56e8e420a228a248f95586cabb09eb279feb/base/src/main/java/net/techcable/spawnshield/tasks/KnockbackTask.java#L50
playerEntity.setVelocity(knockback);
I would like to point out the fact that packets sent because of "setVelocity()" will have no effects whatsoever on hacked clients that have antiknockback, like nothing happened (tested with Wurst).
And some plugins such as NCP have no "antiknockback" check.
Maybe add warning about this or something... there isn't much that can be done about this, except maybe check if player really moved etc but that would prob. be too expensive (PlayerMoveEvent or task every few ticks).
Just a thought :)