Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enchantments cause falses due to new 1.21 attributes and PacketEvents unable to read enchants #1583

Closed
hmRemi opened this issue Jul 1, 2024 · 11 comments · Fixed by #1587
Closed
Labels
false positive False positive

Comments

@hmRemi
Copy link

hmRemi commented Jul 1, 2024

Describe the false positive and how to replicate it

Here are some issues I encountered within the first five minutes of using this anticheat:

  • Using a trident in water results in a simulation flag.
  • Swimming with the Depth Strider enchantment also triggers a simulation flag.
  • Using a pickaxe with any efficiency enchantment causes a fast break flag.

There are likely more issues, but I haven't had the chance to test further yet.

Grim version

2.3.65

Server version

Paper 1.21-38-master@1f5db50

Plugins

CoreProtect, Delta (custom core), FastAsyncWorldEdit, PlaceholderAPI

@hmRemi hmRemi added the false positive False positive label Jul 1, 2024
@SamB440
Copy link
Collaborator

SamB440 commented Jul 1, 2024

It's not ignoring them, it's because Mojang completely changed the calculations in 1.21

@SamB440 SamB440 changed the title Checks seem to be ignoring enchantments Enchantments cause falses due to new 1.21 attributes Jul 1, 2024
@Cats1337
Copy link

Cats1337 commented Jul 2, 2024

I've also found this issue. Efficiency sets off fastbreak alert, depth strider sets off simulation alert and drowns players. I tried to modify the config to help with it but to no avail. Packets clearly aren't being handled correctly.

@SamB440
Copy link
Collaborator

SamB440 commented Jul 2, 2024

Please read what I said, it's not a packet issue, it's an issue with viaversion + Mojang changing everything to use attributes which also changed the movement calculations. My attribute-rework branch fixes this, but it is complicated to fix:

attributeMap.put(Attributes.GENERIC_WATER_MOVEMENT_EFFICIENCY, ValuedAttribute.ranged(Attributes.GENERIC_WATER_MOVEMENT_EFFICIENCY, 0, 0, 1)
.withGetRewriter(value -> {
// On clients < 1.21, use depth strider enchant level always
final double depthStrider = EnchantmentHelper.getMaximumEnchantLevel(player.getInventory(), EnchantmentTypes.DEPTH_STRIDER, PacketEvents.getAPI().getServerManager().getVersion().toClientVersion());
if (depthStrider == 0) {
return 0d;
}
if (player.getClientVersion().isOlderThan(ClientVersion.V_1_21)) {
return depthStrider;
}
// Server is older than 1.21, but player is on 1.21+ so return depth strider value / 3 to simulate via
// https://github.com/ViaVersion/ViaVersion/blob/dc503cd613f5cf00a6f11b78e52b1a76a42acf91/common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/storage/EfficiencyAttributeStorage.java#L34
if (PacketEvents.getAPI().getServerManager().getVersion().isOlderThan(ServerVersion.V_1_21)) {
return depthStrider / 3;
}
// We are on a version that fully supports this value!
return value;
})

@Incluuu
Copy link

Incluuu commented Jul 6, 2024

I've also found this issue. Efficiency sets off fastbreak alert, depth strider sets off simulation alert and drowns players. I tried to modify the config to help with it but to no avail. Packets clearly aren't being handled correctly.

I have te same problem
image

@SamB440 SamB440 changed the title Enchantments cause falses due to new 1.21 attributes Enchantments cause falses due to new 1.21 attributes and PacketEvents unable to read enchants Jul 13, 2024
@SamB440 SamB440 pinned this issue Jul 16, 2024
@SergioK29
Copy link

Can confirm this issue

@ghost
Copy link

ghost commented Aug 10, 2024

is there an ETA to the fix?
How do I disable this

@Anthony01M
Copy link
Contributor

is there an ETA to the fix? How do I disable this

no ETA;
Follow these steps to disable FastBreak:

  1. Go to punishments.yml
  2. Search for - "FastBreak"
  3. Replace - "FastBreak" with - "!FastBreak" (or just add a ! before FastBreak but people won't understand or even manage to do something weird and break their whole punishments config)
  4. Restart your server

@ghost
Copy link

ghost commented Aug 10, 2024

Thanks!

@CatTeaA
Copy link
Contributor

CatTeaA commented Aug 12, 2024

Now you can try the latest build version of "attribute-rework". I tested it on 1.21, and players have reported that many enchants misreporting issues have been fixed and can be used normally.

@g0ldyy
Copy link

g0ldyy commented Aug 14, 2024

Hey!
Trident with Riptide still not working.
FastBreak also still false flagging.
I'm running latest Grim commit.

Am I doing something wrong?

@SergioK29
Copy link

Hey! Trident with Riptide still not working. FastBreak also still false flagging. I'm running latest Grim commit.

Am I doing something wrong?

yes
its working fine on latest commit, make sure your server version is 1.21.1 paper

@SamB440 SamB440 unpinned this issue Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false positive False positive
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants