pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.28k stars 1.56k forks source link

Punch knockback still applies when damage is cancelled #3495

Open Govdim opened 4 years ago

Govdim commented 4 years ago

Weapon enchantments affect entities when the EntityDamageByEntityEvent is cancelled

Example: I play the BedWars minigame, and I have a bow with the "PUNCH" enchantment. I shoot at my teammate and the damage does not pass, but the player knockback.

PocketMine-MP: 3.12.1 PHP: 7.2 Server OS: Ubuntu 18.04 Game version: PE/Win10

dktapps commented 4 years ago

This won't be an easy problem to fix on 3.x due to the way the API is designed.

dktapps commented 4 years ago

related: #2922

dktapps commented 4 years ago

I'm of two minds whether this is actually a bug or not. Knockback is technically not related to damage at all, just the collision, and as such it shouldn't actually be managed by EntityDamageEvent anyway.

dries-c commented 4 years ago

Sadly there's no way around this since the ProjectileHitEntityEvent isn't cancellable.