Study the source of ClearLagg. It foreaches all entities and clears them like that... You can find ClearLagg here: https://github.com/LegendOfMCPE/ClearLagg/blob/master/src/ClearLagg
Thank you! I concocted something after looking at that, and it works! PHP: foreach($this->HGApi->getServer()->getLevels() as $level) { foreach($level->getEntities() as $entity) { if (!($entity instanceof Creature)){ $entity->close(); } } }