Skip to content

Class ComponentJsonSerializer

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

Converts Minecraft text components to and from their JSON representation.

public static class ComponentJsonSerializer

Inheritance

objectComponentJsonSerializer

Inherited Members

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

Methods

Deserialize(string)

Parses and deserializes a JSON component string.

public static Component Deserialize(string value)

Parameters

value string

The JSON text.

Returns

Component

The deserialized component, or when parsing produces no root node.

Exceptions

JsonException

value is not valid JSON.

Deserialize(JsonNode)

Deserializes a component from a JSON node through the NBT serializer.

public static Component Deserialize(JsonNode node)

Parameters

node JsonNode

The JSON representation.

Returns

Component

The deserialized component.

Serialize(Component)

Serializes a component through its NBT representation.

public static JsonNode Serialize(Component component)

Parameters

component Component

The component to serialize.

Returns

JsonNode

The JSON node representing the component.