static @Nullable Emitable emit(final Component comp) {
    final String type;
    final String id;
    if (comp instanceof BlockNBTComponent) {
      type = BLOCK;
      id = ((BlockNBTComponent) comp).pos().asString();
    } else if (comp instanceof EntityNBTComponent) {
      type = ENTITY;
      id = ((EntityNBTComponent) comp).selector();
    } else if (comp instanceof StorageNBTComponent) {
      type = STORAGE;
      id = ((StorageNBTComponent) comp).storage().asString();
    } else {
      return null;
    }

    return out -> {
      final NBTComponent<?, ?> nbt = (NBTComponent<?, ?>) comp;
      out.tag(NBT)
        .argument(type)
        .argument(id)
        .argument(nbt.nbtPath());

      if (nbt.separator() != null) {
        out.argument(nbt.separator());
      }

      if (nbt.interpret()) {
        out.argument(INTERPRET);
      }
    };
  }
One tag for all NBT components.

@since 4.13.0
text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/standard/NbtTag.java