[SPIGOT-7204] Adding PlayerTeleportEvent.TeleportCause enum for VehicleExitEvent Created: 12/Dec/22  Updated: 25/Dec/24  Resolved: 13/Dec/22

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Sachet Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: event, spigot

Version: CraftBukkit version 3619-Spigot-d90018e-6459934
Guidelines Read: 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! 



 Comments   
Comment by md_5 [ 13/Dec/22 ]

DISMOUNT has been added

Generated at Wed Apr 02 10:20:43 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.