code: public static Set<UUID> getEntityIDsRecursively(final EntityContainer container) {
  	final Set<UUID> result = new HashSet<>();
  
  	walkEntityTree(container,
  		e -> result.add(e.getID()) ? EntityVisitResult.CONTINUE : EntityVisitResult.IGNORE_CHILDREN);
  
  	return result;
      }
docs: Gets the IDs of all the entities (recursive).
  
  @param container
  Entity container.
  
  @return Set of all entity identifiers.
  
  @see #walkEntityTree(EntityContainer, EntityVisitor)