Skip to content

Conversation

@orang3i
Copy link

@orang3i orang3i commented Mar 27, 2025

fixes #12317

fix vanilla tp command firing the EntityTeleportEvent twice and CraftEntity#teleport firing the EntityTeleportEvent twice for cross world teleports.

@orang3i orang3i requested a review from a team as a code owner March 27, 2025 08:43
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Mar 27, 2025
@orang3i
Copy link
Author

orang3i commented Mar 27, 2025

  • for CraftEntity#teleport the event is called twice only for cross world teleports. This was fixed by adding a check before the event call in CraftEntity#teleport to check if the destination and current location are of the same worlds and if they are, we don't call the event and the event is fired from vanilla teleport.

edit : Now it also works for null world teleports

  • for vanilla tp command class, the event call is entirely removed and the event will be called from vanilla teleport.

@orang3i
Copy link
Author

orang3i commented Mar 29, 2025

This pr only fixes the vanilla tp command firing the EntityTeleportEvent twice.

Edit : fixes both issues in #12317

@orang3i
Copy link
Author

orang3i commented Apr 3, 2025

Update: Fixed the boolean check to also trigger event and allow teleport for null worlds in CraftEntity#teleport and prevents double triggering of event in cross world teleports

@Warriorrrr
Copy link
Member

Thank you for your contribution and apologies for the delay, we're currently planning on going ahead with the changes #13181 soon which is a larger rework of the teleport implementation, which also happens to fix both of these issues, so I think it's best if that PR supersedes this one.

@Warriorrrr Warriorrrr closed this Oct 15, 2025
@github-project-automation github-project-automation bot moved this from Awaiting review to Closed in Paper PR Queue Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

EntityTeleportEvent fires twice when entity teleports

2 participants