@NearestPlayer is targeting players that are not the nearest player (and often *VERY* far away)
Summary
I have several mobs that use the @NearestPlayer mechanic and after my latest updates (to dev builds 5006 and 5008) it has seemingly been targeting players that are NOT the nearest player a fair portion of the time.
Steps to reproduce
Load mobs that perform some action on @NearestPlayer that is obvious and then have multiple players online. Have one near the mob trigger the action. A different player will be affected by it much of the time. I would attempt to replicate with QueenChrysalis or the Changeling: it seems to usually initially use the nearest player and then the next time use a different one... hard to replicate when you get kicked, though I have had reliable players report it with the kick as well.
Sample mobs with the issue: https://paste.gg/p/Momshroom/9d038b5c46084d93af7153e2ff7aa6e5 -- These disguise as a different online player rather than the nearest. https://paste.gg/p/Momshroom/6c60a66149aa4d12a85a683ecc93b2b9 -- this one kicks a different online player!!!
Current behavior
A player who is not the nearest (nor even near) the mob suffers the effects of @NearestPlayer when a player is fighting the mobs. It seems to be consistent for a while which player... perhaps the 2nd nearest, I'm not sure.
Intended correct behavior
The player nearest the mob should get the effects from @NearestPlayer
Server log file
https://paste.gg/p/Momshroom/27d53d8dde064dfcbd9c6181a77e3933 (No mobs were summoned here: it's just the boot up, join and shutdown
Debug log snippet
https://paste.gg/p/Momshroom/a46fe08b1d614bbd9d2cf31c4fd35062
Proposed fixes
Revert the behavior to target the nearest player again.
Version Info Mythic Mobs build 5008 [16:27:38 INFO]: This server is running Paper version git-Paper-436 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 850b736) You are 10 version(s) behind Download the new version at: https://papermc.io/downloads/paper Previous version: git-Paper-408 (MC: 1.20.4)
ver mythicmobs [16:27:42 INFO]: MythicMobs version 5.6.2-SNAPSHOT-84df489d [16:27:42 INFO]: The total solution for all things mob-related. [16:27:42 INFO]: Author: Lumine