Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6131

EntityDeathEvent triggered when listening to PlayerDeathEvent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • Java 14

    • CraftBukkit version git-Spigot-b5a13e6-b8ee6a8 (MC: 1.16.2) (Implementing API version 1.16.2-R0.1-SNAPSHOT)
    • Yes

      When using the registerEvent method of PluginManager (the one with a custom EventExecutor), the PlayerDeathEvent is also triggered on an EntityDeathEvent.

      The following code:

      Bukkit.getPluginManager().registerEvent(
              PlayerDeathEvent.class,
              new Listener() {},
              EventPriority.NORMAL,
              (listener, event) ->
                      System.out.println("PlayerDeathEventTest >> event type: " + event.getEventName()),
              Manager.Companion.getINSTANCE()
      );
      

      ...produces the following output (e.g. when killing a player and then burning some zombies):

      [19:49:09] [Server thread/INFO]: PlayerDeathEventTest >> event type: PlayerDeathEvent
      [19:49:09] [Server thread/INFO]: bluefireoly fell out of the world
      [19:49:09] [Server thread/INFO]: [bluefireoly: Killed bluefireoly]
      [19:49:42] [Server thread/INFO]: PlayerDeathEventTest >> event type: EntityDeathEvent
      [19:49:42] [Server thread/INFO]: PlayerDeathEventTest >> event type: EntityDeathEvent
      [19:49:43] [Server thread/INFO]: PlayerDeathEventTest >> event type: EntityDeathEvent
      

            Unassigned Unassigned
            bluefireoly jakob
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: