Paper: PlayerPreTeleportEvent

Created on 28 Jul 2018  路  4Comments  路  Source: PaperMC/Paper

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.

accepted feature

Most helpful comment

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?

All 4 comments

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.

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?

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

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.

Was this page helpful?
0 / 5 - 0 ratings