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

Fix EntityTeleportEvent triggering twice #12346

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

orang3i
Copy link

@orang3i orang3i commented Mar 27, 2025

partially fixes #12317

fix vanilla tp command firing the EntityTeleportEvent twice

@orang3i orang3i requested a review from a team as a code owner March 27, 2025 08:43
@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.

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting review
Development

Successfully merging this pull request may close these issues.

EntityTeleportEvent fires twice when entity teleports
1 participant