BUKKIT: The plugin that checks for a player falling into the void does not work correctly

I'm trying to teleport a player to random coordinates of another world when falling into the void from the spawn world. I managed to catch this event, but when teleporting a player to another world with the command /mvtp player world from the console, the player is teleported to the wrong place at all. I also tried using player.teleport(new Location(...)), but the player teleports everything to the same place (underground) and he dies

Maybe I'm doing something wrong?

I use the multiverse core plugin on multi-worlds and advancedrandomteleport for random teleportation.

Code:

Code

Author: Илья, 2020-10-18