[SPIGOT-1599] Not possible to teleport players in PlayerQuitEvent Created: 01/Mar/16  Updated: 30/Jun/16  Resolved: 30/Jun/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Brokkonaut Assignee: Unassigned
Resolution: Fixed Votes: 6
Labels: None

Issue Links:
Duplicate
is duplicated by SPIGOT-2048 Can't teleport players on disconnect Resolved
is duplicated by SPIGOT-2467 PlayerQuitEvent - Teleport Resolved

 Description   

When a players leaves the server, it is no longer possible to teleport him in the PlayerQuitEvent using player.teleport(Location). the teleport method returns false and does not change the players location.

In 1.8 this worked and it is important for many minigame plugins.



 Comments   
Comment by t. hartmann [ 05/Jun/16 ]

Same problem here, On PlayerQuitEvent no teleport works.
Version:

git-Spigot-798f32d-0cd0397 (MC: 1.9.4) (Implementing API version 1.9.4-R0.1-SNAPSHOT)

Comment by blablubbabc [ 24/May/16 ]

For anyone reviewing this: I assume that the issue is related to a small change in PlayerConnection.isDisconnected():
'!this.networkManager.channel.config().isAutoRead()' was changed to '!this.networkManager.isConnected()'

And networkManager.isConnected() returns false already when bukkit handles the player quit after the player 'disconnected'. networkManager.channel.config().isAutoRead() still returned true in this case.

Possible solutions might be:

  • Reverting this change: So any other server code which might rely on the old behavior would get 'fixed' as well.
  • Remove the 'entity.playerConnection.isDisconnected()' check inside CraftPlayer.teleport(..). It might not even make much sense to check for that there anyways, because it already checks if the player entity is still alive, and the player entity always gets killed by the server after the server has handled the player quit (so this check might be redundant anyways).
  • Add some sort of 'this.player.left' flag to the isDisconnected method, similar to how there already is a '!this.player.joining', which gets set after the player quit has been handled.
Comment by Mine Home [ 12/Apr/16 ]

Bugfix would be very important for me!

Generated at Tue Apr 15 11:10:14 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.