Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlayerPreTeleportEvent #1285

Closed
molor opened this issue Jul 28, 2018 · 5 comments
Closed

PlayerPreTeleportEvent #1285

molor opened this issue Jul 28, 2018 · 5 comments
Labels
type: feature Request for a new Feature.

Comments

@molor
Copy link

molor commented Jul 28, 2018

If any plugin teleports a player using Entity#teleport(), and the player has at least one passenger, then in fact he will not be teleported, but the plugin will consider otherwise.

It is not possible to remove passengers from the player using PlayerTeleportEvent, as in this case it is not called. However, if it was called - it's still useless, because the player would not have been teleported.

So I suggest adding an PlayerPreTeleportEvent that will be called before the actual teleport, but immediately after Entity#teleport() is invoked, so that passengers can be removed using custom plugin and they do not interfere with the process of teleportation.

You can also solve this problem by removing passengers in the Entity#teleport() method itself.

@molor
Copy link
Author

molor commented Jul 28, 2018

In mini-games, this can seriously interfere with the gameplay. For example, MobArena will assume that the player has been moved to the arena and already takes damage from mobs, but in fact he is on spawn and looks in the chat, what is now the wave number and what prizes he received.

@aikar
Copy link
Member

aikar commented Jul 28, 2018

I have changes in my fork that i've been meaning to bring to paper that allows entities to teleport with passengers, wouldn't that be better?

@BillyGalbreath
Copy link
Contributor

@aikar I would love that teleport with passengers patch ^_^

@zachbr zachbr added api type: feature Request for a new Feature. labels Apr 5, 2019
@kashike kashike removed the api label Aug 23, 2020
@Proximyst
Copy link
Contributor

Potential patches to pull for this issue:

These are different solutions with different mindsets to the same problem, so we'll have to decide for one or the other. EmpireCraft's seems to be the one which would best fit in this case, given it fixes the contract in Entity which does not state vehicles cannot be teleported.

@Proximyst Proximyst added the status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. label Nov 14, 2020
@Laarryy
Copy link

Laarryy commented Aug 5, 2022

As far as I can read, this has been addressed at https://github.com/PaperMC/Paper/blob/master/patches/server/0920-More-Teleport-API.patch#L39-L63

If it hasn't or this code is faulty, please open a new issue for an amendment to the aforementioned patch. Thanks!

@Laarryy Laarryy closed this as completed Aug 5, 2022
@Laarryy Laarryy added resolution: manually merged and removed status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. labels Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Request for a new Feature.
Projects
None yet
Development

No branches or pull requests

8 participants