delete entity 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();
});