-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
1.19
-
Yes
As it wasn't possible to teleport a player in the past without him leaving the vehicle he is in, Spigot is automatically dismounting the player to keep the client and the server synchronized. However, with the newer versions of Minecraft, there's a new parameter within the PacketPlayOutPosition packet (the packet that gets sent to the player when he is teleporting).
My suggestion is to remove the following from CraftPlayer#teleport(Location location, PlayerTeleportEvent.TeleportCause cause):
entity.stopRiding();
and to adapt the methods that finally call
PlayerConnection#internalTeleport(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set, boolean flag);
The "flag" parameter is deciding whether the player shall be dismounted or not. As of now, Spigot is passing true to that method whenever Player#teleport is being called.
It is not possible to properly teleport riding players without accessing NMS. My suggestion would change that.
- relates to
-
SPIGOT-2064 Unable to teleport entity that has a passenger
- Open
-
SPIGOT-4176 PlayerPreTeleportEvent
- Open
-
SPIGOT-6286 Provide PreAPIEntityTeleportEvent
- Open