Bug Open

`getEntitiesNearLocation` warning prints `{0}` and `{1}` instead of the coordinates

#10140 opened by chikage_ 1 hour ago

chikage_reported this bug

Logs

[00:03:06] [Server thread/WARN]: [MythicMobs] getEntitiesNearLocation: invalid location (∞/NaN) → X={0}, Z={1}
[00:03:21] [Server thread/WARN]: [MythicMobs] getEntitiesNearLocation: invalid location (∞/NaN) → X={0}, Z={1}
[00:04:06] [Server thread/WARN]: [MythicMobs] getEntitiesNearLocation: invalid location (∞/NaN) → X={0}, Z={1}
[00:04:22] [Server thread/WARN]: [MythicMobs] getEntitiesNearLocation: invalid location (∞/NaN) → X={0}, Z={1}

All 25,851 lines are identical. None of them contains a real coordinate.

Problem

The warning cannot be used for diagnosis. The {0} and {1} placeholders are printed as plain text, so the invalid values never appear. The message also gives no skill, mob, caster, world or calling mechanic, and it has no stack trace.

The source of the invalid location stays hidden. The method only reports that it received a bad location. Many features call it, including radius conditions, radius targeters, cone targeters, shapes, projectiles, and the orbital, polygon, rally and slash mechanics. From the log alone, I cannot tell which one is involved or whether the cause is a config value or a bug in MythicMobs.

The failure is silent in game. The method returns an empty list, so the calling skill behaves as if no entity was nearby. A skill can stop working without any useful error.

Solution

  1. Format the message so the real X and Z values are printed.
  2. Add context: the skill and mechanic when available, the caster or mob, and the world.
  3. Offer a stack trace in debug mode, so the caller can be identified.
  4. Limit repeated warnings, for example by logging each source once over a time window with a count.
  5. Confirm that the check covers both infinite and NaN coordinates. The message mentions both, but the older decompiled build only checks for infinite values.
mikekeviecommented

I would like to see how you cause this

chikage_commented

let me search

Sign in to join the discussion.