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
481 stars 100 forks source link

`PlayerDeathEvent#getPlayer#getLastDamageCause#getCause` returns `DamageCause.CUSTOM` if NCP is installed #185

Closed molor closed 2 years ago

molor commented 2 years ago

Full output of /ncp version

[10:29:39] »Version information«
[10:29:39] Server:
[10:29:39] git-Paper-103 ~MC: 1.18.1~
[10:29:39] Detected: 1.18.1
[10:29:39] NoCheatPlus:
[10:29:39] Plugin: 3.17-SNAPSHOT-Updated-b127
[10:29:39] MCAccess: 1.13-1.18|? / Bukkit-API
[10:29:39] Features:
[10:29:39] 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, BlocksMC1_17, MCAccessBukkitModern
[10:29:39] checks: FastConsume, Gutenberg, HotFixFallingBlockPortalEnter, AttackFrequency, FlyingFrequency, KeepAliveFrequency
[10:29:39] defaults: pvpKnockBackVelocity
[10:29:39] packet-listeners: UseEntityAdapter, MovingFlying, OutgoingPosition, KeepAliveAdapter, SoundDistance, WrongTurnAdapter, NoSlow, Fight
[10:29:39] Hooks:
ViolationFrequency~NCP~ 1.0
[10:29:39] »Related Plugins«
[10:29:39] ProtocolLib v4.8.0-SNAPSHOT-b539

Describe the issue

Our death messages plugin uses PlayerDeathEvent(MONITOR)#getPlayer#getLastDamageCause#getCause to get cause of player death and then broadcast a message.

But if NCP is installed, #getCause returns DamageCause.CUSTOM instead of DamageCause.FALL if player died from falling. Because of this, the messages are broadcasts wrongly. There was no such problem until the recent updates (< 1.18.1), so most likely the change is somewhere in the latest commits

How to reproduce the issue

Important: This problem never happens if player have operator status or all permissions. It works fine for me, but others are falling and dying with DamageCause.CUSTOM. Also I don't know what permission is related :/

molor commented 2 years ago

Update: Related permission is nocheatplus.checks.moving, with it everything works fine :c

molor commented 2 years ago

Update 2: Everything works fine if checks.moving.nofall.dealdamage in config is set to false

xaw3ep commented 2 years ago

Done!