Encodes the given element to an instance of the class T.
Encodes the given value to an Tag. If the given value of the type T can be represented by a primitive NbtElement, such an element will be the result of this function. Otherwise, an net.minecraft.nbt.CompoundTag will be created.