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

Adding PlayerTeleportEvent.TeleportCause enum for VehicleExitEvent

    XMLWordPrintable

Details

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

    Description

      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! 

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: