Damage Event Weapon Inconsistency #11329
Labels
status: needs triage
type: bug
Something doesn't work as it was intended to.
version: 1.20.4
Game version 1.20.4
Expected behavior
I expect that when a Player triggers
EntityDamageEvent
&EntityDamageByEntityEvent
through a melee attack thatplayer.getEquipment().getItemInMainHand() or player.getInventory().getItemInMainHand()
will return the weapon used to damage the entity.Observed/Actual behavior
When attacking immediately after switching slots the new slot will be the mainhand, while the entity was hit with item in the previous slot. This behaviour can be verified by comparing the damage values with the weapon type in the video below.
With some practise this can be easily abused by switching to a slow weapon that triggers an ability within this event. Basically ignoring the slower attackspeed and still triggering the ability.
Steps/models to reproduce
DamageEventWeapon.1.-.Trim.mp4
Plugin and Datapack List
Paper version
This server is running Paper version git-Paper-497 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: d8d54d9 on ver/1.20.4)
You are running the latest version
Other
Listeners used in the video:
The text was updated successfully, but these errors were encountered: