Sprinting Into Wall Causes Anti-Cheat Flagging
General Information
https://dump.viaversion.com/34ef146dd45671d8eabd0aab9f7b9bb35e96c1eaf34621bc4eabd3c1a6134a8f
Bug Description
In 1.8 and below, when sprinting into a wall, it flags anticheat GrimAC.
Steps to Reproduce
Join eu.loyisa.cn w/ version 1.8 Go to a block, spam W (w/ toggle sprint enabled, also happens even without toggle sprint)
Expected Behavior
No flagging
BadPacketsX seems to flag due to duplicate packets
public void onPacketReceive(PacketReceiveEvent event) {
if (player.gamemode == GameMode.SPECTATOR || isTickPacket(event.getPacketType())) {
sprint = sneak = false;
return;
}
if (event.getPacketType() == PacketType.Play.Client.ENTITY_ACTION) {
switch (new WrapperPlayClientEntityAction(event).getAction()) {
case START_SNEAKING, STOP_SNEAKING -> {
if (sneak) {
if (player.canSkipTicksPreVia() || flagAndAlert()) {
flags++;
}
}
sneak = true;
}
case START_SPRINTING, STOP_SPRINTING -> {
if (player.inVehicle()) {
return;
}
if (sprint) {
if (player.canSkipTicksPreVia() || flagAndAlert()) {
flags++;
}
}
sprint = true;
}
}
}
}
Yeah, it's multiple actions in one tick. The other BadPackets check is checking for very close position updates. My assumption was sendMovementPackets() or tick() inside the ClientPlayerEntity to be called too often?
I may have found the cause for this
Latest:
profiler.push("rest");
boolean bl = !MathHelper.approximatelyEquals(movement.x, vec3d.x);
boolean bl2 = !MathHelper.approximatelyEquals(movement.z, vec3d.z);
this.horizontalCollision = bl || bl2;
17w46a (Pre-Collision change)
this.world.profiler.push("rest");
this.setPositionFromShape();
this.collidingHorizontally = n != x || p != z;
This is in the Entity Class under the move func
Looks interesting even if it doesn’t fix it, should probably still be fixed / added if not already
I just did some testing with viaproxy and was unable to flag BadPacketsX even on latest, it's definitely a VFP change that is causing the flag.
Oh well, that's bad lol
I may have found the cause for this
Latest:
profiler.push("rest"); boolean bl = !MathHelper.approximatelyEquals(movement.x, vec3d.x); boolean bl2 = !MathHelper.approximatelyEquals(movement.z, vec3d.z); this.horizontalCollision = bl || bl2;17w46a (Pre-Collision change)
this.world.profiler.push("rest"); this.setPositionFromShape(); this.collidingHorizontally = n != x || p != z;This is in the Entity Class under the move func
Seems important, but it doesn't seem to fix the issue sadly. Still would be good to add