Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5252

PlayerPortalEvent causes spurious PlayerTeleportEvent TeleportCause.UNKNOWN with wrong world

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
      • Linux x86_64
      • OpenJDK Runtime Environment (build 1.8.0_212-b04)
      • Single test plugin for logging `PlayerTeleportEvent` and `PlayerPortalEvent`. No other plugins loaded.
    • git-Spigot-e5b1b5d-1ec1b05 (MC: 1.14.4)
    • Yes

      Spigot raises spurious `PlayerTeleportEvent`s when players travel through portals. This is particularly a problem for the WorldBorder plugin.

      With the server instrumented with a plugin containing the following code:

          @EventHandler()
          public void onPlayerTeleport(PlayerTeleportEvent event) {
              plugin.getLogger().info("onPlayerTeleport(): " + event.getCause() +
                                      " from " + formatBlockLoc(event.getFrom()) +
                                      " to " + formatBlockLoc(event.getTo()));
          }
      

      and similar logging for `PlayerPortalEvent`, the logged output is:

      onPlayerPortal(): NETHER_PORTAL from (world_nether,296,68,321) to (world,2370,68,2568)
      onPlayerTeleport(): NETHER_PORTAL from (world_nether,296,68,321) to (world,2370,68,2568)
      onPlayerTeleport(): UNKNOWN from (world_nether,2370,68,2568) to (world_nether,2332,65,2466) 
      onPlayerTeleport(): UNKNOWN from (world,2332,65,2466) to (world,2332,65,2466)
      

      The second to last `PlayerTeleportEvent` has `TeleportCause.UNKNOWN`, overworld X, Y and Z but says that those coordinates apply in the nether, which is the wrong world.

      This is possibly related to #1807, but not the same.

            Unassigned Unassigned
            totemoresearch@gmail.com totemo
            Votes:
            9 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: