Bug Open

MythicMobs scheduler freezes when accessing unloaded chunks during world unloading

#10135 opened by chikage_ 7 hours ago

chikage_reported this bug

Description

The global MythicMobs scheduler can become permanently stuck when a mob executes a block-related skill while its world is being unloaded.

Steps to reproduce

  1. Spawn a mob with a skill using BlocksInRadiusTargeter (e.g. a skill that searches for nearby blocks).
  2. Let the skill execute while the mob is inside a world.
  3. Unload the world while the skill is accessing nearby blocks (for example, when an empty dungeon instance is automatically closed).
  4. The MythicMobs scheduler becomes permanently blocked.

Observed behavior

The MythicMobs scheduler gets stuck while attempting to access blocks in a chunk belonging to a world that is being unloaded or has already been unloaded. Since the scheduler is shared across the server, this affects all MythicMobs scheduled tasks, including:

  • Skills executed at intervals.
  • Delayed skills and other scheduled mechanics.
  • Any gameplay mechanics relying on MythicMobs' scheduler.

The issue persists until the server is restarted.

Possible fix

Add a validation before accessing blocks in BlocksInRadiusTargeter to ensure that:

  • The world is still loaded.
  • The target chunk is loaded.
  • Block access is skipped if the chunk is unavailable.

More generally, block-related targeters should safely handle world unloading to prevent the global scheduler from becoming permanently stuck.

Thank you Chikage

Sign in to join the discussion.