1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Check if entity is despawned

Discussion in 'Development' started by xXNiceAssassinlo YT, Aug 6, 2018.

  1. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    How do I check if entity is despAwned
     
  2. DaPigGuy

    DaPigGuy Slime

    Messages:
    86
    GitHub:
    DaPigGuy
    PHP:
    if ($entity->isClosed() || $entity->isFlaggedForDespawn()) {

    }
     
  3. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    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.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.