Skip to content

Class ComponentNbtSerializer

Namespace: Void.Minecraft.Components.Text.Serializers
Assembly: Void.Minecraft.dll

Converts Minecraft text components to and from their NBT representation.

public static class ComponentNbtSerializer

Inheritance

objectComponentNbtSerializer

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

Deserialize(NbtTag)

Deserializes a text component from an NBT tag.

public static Component Deserialize(NbtTag tag)

Parameters

tag NbtTag

A component compound, a compact string component, or an end tag.

Returns

Component

The deserialized component; an end tag produces .

Exceptions

NbtException

The tag shape, required field, or field type is not supported.

Serialize(Component)

Serializes a component tree to an NBT compound using the modern component schema.

public static NbtCompound Serialize(Component component)

Parameters

component Component

The component to serialize.

Returns

NbtCompound

The serialized compound.

Exceptions

NotSupportedException

The component has an unsupported content implementation.