GrimAnticheat / Grim

Fully async, multithreaded, predictive, open source, 3.01 reach, 1.005 timer, 0.01% speed, 99.99% antikb, "bypassable" 1.8-1.20 anticheat.
GNU General Public License v3.0
1.07k stars 310 forks source link

False positive when jumping between beds. #760

Open OmegaMetor opened 2 years ago

OmegaMetor commented 2 years ago

Describe the false positive and how to replicate it

Step one: Setup 2 beds beside each other, with 2 blocks of space in between and blocks on the outside. Step two: Repetedly jump between them. Grim will trigger. Video(mp4)

Grim version

2.3.23

Server version

Paper version git-Paper-81 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT) (Git: 86f87ba)

Plugins

CoreProtect, dynmap, Essentials, EssentialsChat, GrimAC, LuckPerms, ProtocolLib, ServerlistMOTD*, Vault

OpticFusion1 commented 1 year ago

Block's aren't needed. Just walking on/off the bed in a certain way causes it

OpticFusion1 commented 1 year ago

False-Positive Video

SamB440 commented 1 year ago

It appears this is caused by bouncy block handling here: https://github.com/GrimAnticheat/Grim/blob/4a57178743f15ba3776c1b6fd82d2451d14b02b3/src/main/java/ac/grim/grimac/predictionengine/predictions/PredictionEngine.java#L63-L70

Changing this to

boolean valid = BlockProperties.getOnBlock(player, player.x, player.y, player.z) == StateTypes.SLIME_BLOCK || (player.lastOnGround && !player.onGround);
if (player.uncertaintyHandler.influencedByBouncyBlock() && valid) {

fixes this, and also another ground spoof flag not shown on the video, (tested on 1.8 and 1.19) however I would not be surprised if this broke something (or whether this check should even be at this point, or if there's a deeper problem here!). Should I make a PR?


There also seems to be some general issues surrounding slime blocks, such as stepping off it sometimes falses: https://paste.grim.ac/hDxkZ (line 509). I am also able to use hacks such as LiquidBounce's BlockBounce on slime blocks to jump higher than possible at a constant rate, up to around 0.6, after bouncing ~3 blocks legitimately once. However, I am unsure if this is related, but it does suggest bounce handling is possibly flawed in general.

Note that this does not occur for bed blocks - but that might be because they don't apply as much velocity and LB only lets me go down to 0.2? Would be useless below that anyway.

~~Handling velocity on blocks such as slimes is certainly possible to a certain degree, this is a simplified version of what the SlimeBlock class does, but I'm not seeing Grim using it anywhere? I would be interested to know why as I was surprised about this Should I make a separate issue for this?~~

Edit: Grim does indeed handle it, but I'm gonna go deeper and see if the various other issues could be resolved in some way.

Sorry for the long and slightly off-topic comment, just felt like doing some research into this.

OmegaMetor commented 1 year ago

If the issue with this is just an issue with how grim handles bouncy blocks, a separate issue may not be needed. If you have a fix for the bed stuff, a pr would be good, unless you want to also look into the whole slime stuff more, as that could also probably all go together in one pr. tl;dr, yes unless you want to look more into it.

Hwaanx commented 10 months ago

This is still not fixed