Don't teleport entities that are considered dead. Addresses BUKKIT-1331
Teleportation should never be processed on dead entities. If you wish to teleport an entity, do it on a living entity. If you wish to teleport a player, set their respawn location in PlayerRespawnEvent.
This commit is contained in:
@@ -348,6 +348,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) {
|
||||
EntityPlayer entity = getHandle();
|
||||
|
||||
if (getHealth() == 0 || entity.dead) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entity.playerConnection == null || entity.playerConnection.disconnected) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user