Class NbtJsonSerializer
Namespace: Void.Minecraft.Nbt.Serializers.Json
Assembly: Void.Minecraft.dll
Serializes NBT tags as natural JSON values and infers tag types while deserializing.
public static class NbtJsonSerializerInheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Fields
Options
Gets the shared mutable serializer options containing all NBT and UUID converters.
public static readonly JsonSerializerOptions OptionsField Value
Methods
Deserialize(string)
Deserializes JSON text, falling back to an NBT string when the input is not valid JSON.
public static NbtTag Deserialize(string value)Parameters
value string
The JSON text or literal string value.
Returns
The inferred NBT tag.
Deserialize(JsonNode)
Deserializes a JSON node to an inferred NBT tag.
public static NbtTag Deserialize(JsonNode node)Parameters
node JsonNode
The JSON node.
Returns
The inferred NBT tag.
Exceptions
No tag can be deserialized from the node.
Serialize(NbtTag)
Serializes an NBT tag to a JSON node.
public static JsonNode Serialize(NbtTag tag)Parameters
tag NbtTag
The tag to serialize.
Returns
The JSON representation.
Exceptions
Serialization produces no JSON node.