code: function getNetworkedEntity(entity) {
    return new Promise((resolve, reject) => {
      let curEntity = entity;
  
      while(curEntity && curEntity.components && !curEntity.components.networked) {
        curEntity = curEntity.parentNode;
      }
  
      if (!curEntity || !curEntity.components || !curEntity.components.networked) {
        return reject("Entity does not have and is not a child of an entity with the [networked] component ");
      }
  
      if (curEntity.hasLoaded) {
        resolve(curEntity);
      } else {
        curEntity.addEventListener("instantiated", () => {
          resolve(curEntity);
        }, { once: true });
      }
    });
  }
docs: Find the closest ancestor (including the passed in entity) that has a `networked` component
  @param {ANode} entity - Entity to begin the search on
  @returns {Promise<ANode>} An promise that resolves to an entity with a `networked` component