serialize

@NotNull
abstract fun <T> serialize(@NotNull codec: @NotNull Codec<T>, @NotNull value: @NotNull T): @NotNull DataResult<CustomValue>(source)

Serializes the given object with the given codec.

Return

The serialized result

Parameters

codec

The codec to serialize with

value

The object to serialize

<T>

The type the codec serializes

See also

<a href="https://fabric.mineblock11.dev/misc/codecs">Codec docuemntation</a>