1 second to remove the villager PHP: $entity = new Villager($entity->getLevel(), Villager::createBaseNBT($position)); $entity->setNameTag("§l§c-".$damage); $entity->setScale(0.0005); $entity->spawnToAll(); $entity->getHealth()-$entity->getMaxHealth(); //time $entity->close()
That's a no no. sleep() function will literally stop the whole server. PHP: $this->getScheduler()->scheduleDelayedTask(new ClosureTask(function (int $currentTick) use ($entity) : void { $entity->close();}), 20); // 20 ticks(1 second) Use this instead