public static NBTBase shadow(Object nbtObject) {
        // first, shadow as a NBTBase
        NBTBase shadow = ShadowFactory.global().shadow(NBTBase.class, nbtObject);

        // extract the tag's type
        NBTTagType type = shadow.getType();
        Class<? extends NBTBase> realClass = type.shadowClass();

        // return a shadow instance for the actual type
        return ShadowFactory.global().shadow(realClass, nbtObject);
    }
Utilities for working with NBT shadows.
helper/src/main/java/me/lucko/helper/nbt/NBT.java