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

Adding PlayerTeleportEvent.TeleportCause enum for VehicleExitEvent

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • CraftBukkit version 3619-Spigot-d90018e-6459934
    • Yes

      I wasn't entirely sure whether to classify this as a bug or a feature request (as it could just be an oversight) but I ran into a problem with the PlayerTeleportEvent being called for non-teleporting-like events while developing a plugin I'm working on.

      I think what's happening is that when a player exits a vehicle/entity, the VehicleExitEvent is calling the PlayerTeleportEvent. However, there is no known enum for this call in PlayerTeleportEvent.TeleportCause. This makes it quite hard to distinguish whether the player is truly teleporting or is simply just exiting a vehicle. I'm currently using the workaround of ignoring UNKNOWN cause teleports, because I'm banking on the assumption that if a player is teleporting, it'll be through a command, plugin, or one of the already documented enums. However, I'm not entirely sure what would get lost by ignoring all UNKNOWN causes.

      Look forward to any input you can provide on this! 

            Unassigned Unassigned
            CoolLord22 Sachet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: