found onPlayerDeathEvent(PlayerDeathEvent event) bug

  • English
  • found onPlayerDeathEvent(PlayerDeathEvent event) bug

    Hi @red51

    We had some strange behaviour where players would experience multiple death messages sometimes when they die - which clearly they should only get one death message.

    I have discovered the cause of this behaviour. The following method gets called when a player dies, however, when a player is already dead and their dead body is hit, this method gets called again for each hit on the dead body.

    Source Code

    1. public void onPlayerDeathEvent(PlayerDeathEvent event) {
    2. }
    The result of which is a player gets multiple deaths registered against them.


    This method stops getting called when the player who died respawns or disconnects. But whilst remaining on the Game Over screen this method keeps getting called (each time they are hit).


    Edit: Circumvented in the meantime with some locking logic... . so no rush to fix, just thought I would let you know about it. Maybe it's intentional behaviour? ^^
    play: server.medievalrealms.co.uk website: medievalrealms.co.uk discord: discord.medievalrealms.co.uk

    The post was edited 5 times, last by yahwho ().