Updated-NoCheatPlus / NoCheatPlus

Anti-cheating plugin for Minecraft (1.5-1.20, Bukkit/Spigot)
https://ci.codemc.io/job/Updated-NoCheatPlus/job/Updated-NoCheatPlus/
GNU General Public License v3.0
482 stars 100 forks source link

NCP Combat Checks Compltely Broken, not even detecting KA at max settings #104

Closed TechnicallyCoded closed 3 years ago

TechnicallyCoded commented 3 years ago

---- Version information ----

[18:45:13 INFO]: #### Server ####
[18:45:13 INFO]: git-Paper-391 ~MC: 1.16.4~
[18:45:13 INFO]:   detected: 1.16.4
[18:45:13 INFO]: #### NoCheatPlus ####
[18:45:13 INFO]: Plugin: 3.17-SNAPSHOT-Updated-b92
[18:45:13 INFO]: MCAccess: 1.13-1.16|? / Bukkit-API
[18:45:13 INFO]: Features:
[18:45:13 INFO]:   blocks: BlocksMC1_4 | BlocksMC1_5 | BlocksMC1_6_1 | BlocksMC1_7_2 | BlocksMC1_8 | BlocksMC1_9 | BlocksMC1_10 | BlocksMC1_11 | BlocksMC1_12 | BlocksMC1_13 | BlocksMC1_14 | BlocksMC1_15 | BlocksMC1_16 | MCAccessBukkitModern
[18:45:13 INFO]:   checks: FastConsume | Gutenberg | HotFixFallingBlockPortalEnter | AttackFrequency | FlyingFrequency | KeepAliveFrequency
[18:45:13 INFO]:   defaults: pvpKnockBackVelocity
[18:45:13 INFO]:   packet-listeners: UseEntityAdapter | MovingFlying | OutgoingPosition | KeepAliveAdapter | SoundDistance | WrongTurnAdapter | NoSlow | Fight
[18:45:13 INFO]: Hooks: AllViolations~NCP~ 1.0 | ViolationFrequency~NCP~ 1.0
[18:45:13 INFO]: #### Related Plugins ####
[18:45:13 INFO]: ProtocolLib v4.6.0

Describe the issue

None of the Fight checks are flagging the anticheat.. the only one I had detect me was direction about twice ... using the most blatant killaura settings possible with 6 blocks reach. Something is severly nerfed or completely disabled. The old version of NCP instant kicks me for the settings I am using, so it used to work. NOTE: All other checks work just fine (flight, block reach, etc..)

How to reproduce the issue

Just start killaura-ing like crazy with 6 blocks reach, there isn't really much I did other than that..

Extra links/Videos (Including debug logs)

https://youtu.be/J7FF2W3dB9I

Any possible config options changed or plugins that may cause interference?

These checks do not work even after a clean install of the plugin (aka clean config file) Plugins: FAWE, IPWhitelist, JPremium, LuckPerms, NoCheatPlus, ProtocolLib, Vault All permissions for the test account were cleared before testing (there are no exemptions)

TechnicallyCoded commented 3 years ago

I will also add that I have tried the plugin without ProtocolLib. I have tried forcing all active: true (in config) I have tried this on a local test server as well as the server that this video is from.

TechnicallyCoded commented 3 years ago

Found the issue and fixed it locally. If the damaged player has NCP bypass (not the attacker) the onEntityDamage method returns instantly. Just wrapped what comes after in an opposite if statement and added a null check for the damagerData in the next method down the line after checking its an instance of EntityDamageByEntityEvent.

That should have just made this the easiest fix out there..