Bug Open

MythicMobLootDropEvent / MythicMobDeathEvent not firing on MythicMob death

#6906 opened by Unknown 6 months ago

Unknownreported this bug

Server occasionally fails to fire MythicMobLootDropEvent and MythicMobDeathEvent when a MythicMob dies. When this happens, on-death skills and loot/commands do not execute reliably. After running /mm reload, the issue seems to disappear and everything works normally again.

Environment:

Server Version: 1.21.10 v1_21_R6 (Paper)

Plugin Version: 5.11.2

Is Premium: Yes

Is Dev Build: Yes

Supported Version: Yes

Steps to reproduce

Start the server normally (no /mm reload yet).

Enable MythicMobs debug for relevant systems (if needed) and spawn/kill the same MythicMob repeatedly.

Observe that sometimes, upon the mob’s death, the server log does not show MythicMobLootDropEvent and MythicMobDeathEvent, and the expected loot / on-death skills / commands do not run.

Run /mm reload.

Repeat step 2–3. After /mm reload, the events and loot/skills appear to behave normally again.

Current behavior

Randomly, when the MythicMob is killed:

MythicMobLootDropEvent and MythicMobDeathEvent are not fired (or at least not logged / not executed).

On-death skills and loot drops do not execute correctly (including command-based rewards).

This happens intermittently (not 100% reproducible every kill).

After running /mm reload, the issue seems to stop and death/loot behavior becomes consistent again.

Intended correct behavior

Every time the MythicMob dies:

MythicMobLootDropEvent and MythicMobDeathEvent should always fire consistently.

On-death skills should always trigger as configured.

Loot drops / command rewards should always be generated and given as configured.

Proposed fixes

Not sure yet. Observations:

The issue is intermittent and seems to “fix itself” after running /mm reload, suggesting a possible state/registration/handler issue that becomes correct after reload.

It may be related to event listeners not being registered correctly at startup or becoming invalid over time, and /mm reload reinitializes them.

Potential areas to investigate: event dispatch/registration on startup, entity death handling, and any interactions with other plugins that modify death handling or entity removal.

If needed, I can provide additional test results, timings, and additional debug logs.

Unknowncommented

Event sequence: Entity dead (isValid -> false) MythicClock async tick the entity, set entity dead EntityDeathEvent called

Possible solutions: Don't tick entity async

Sign in to join the discussion.