Skip to content

Cancelling the EntityDamageEvent and using setHealth(0) will call PlayerDeathEvent twice #12148

@Mykindos

Description

@Mykindos

Expected behavior

PlayerDeathEvent should only be called once

Observed/Actual behavior

PlayerDeathEvent is called twice

Steps/models to reproduce

Listen to an EntityDamageEvent and PlayerDeathEvent.

if the entity in the damage event is a player, cancel the event and call entity.setHealth(0);

Take fall damage or something so that you die, and the player death event will be called twice

Plugin and Datapack List

Irrelevant, confirmed by @lynxplay

Paper version

This server is running Paper version 1.21.4-164-main@8eb8e44 (2025-02-16T22:13:26Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are 8 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: 1.21.1-119-7cd4f2c (MC: 1.21.1)

Other

Did not used to happen on 1.21.1 or earlier

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.version: 1.21.4Game version 1.21.4

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions