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

PlayerPortalEvent causes spurious PlayerTeleportEvent TeleportCause.UNKNOWN with wrong world

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Environment:
      • Linux x86_64
      • OpenJDK Runtime Environment (build 1.8.0_212-b04)
      • Single test plugin for logging `PlayerTeleportEvent` and `PlayerPortalEvent`. No other plugins loaded.
    • Version:
      git-Spigot-e5b1b5d-1ec1b05 (MC: 1.14.4)
    • Guidelines Read:
      Yes

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            totemoresearch@gmail.com totemo
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: