how to delete an entity in spigot code example
Example: spigot remove every entity
//Get all entities
Bukkit.getWorld("world").getEntities().forEach(entity -> {
//Check if entity isnt a player
if(!(entity instanceof Player))
entity.remove();
});