PHP: if($entity->isFlaggedForDespawn()) {} I don't know about Entities that have already been despawned. I think the object would be closed after that, meaning maybe PHP: if($entity instanceof Entity) might work? I am not sure on that though.