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:
@@ -190,6 +190,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
}
|
||||
|
||||
public boolean teleport(Location location, TeleportCause cause) {
|
||||
if (entity.vehicle != null || entity.passenger != null || entity.dead) {
|
||||
return false;
|
||||
}
|
||||
|
||||
entity.world = ((CraftWorld) location.getWorld()).getHandle();
|
||||
entity.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
// entity.setLocation() throws no event, and so cannot be cancelled
|
||||
|
||||
Reference in New Issue
Block a user