Class NbtProperty
Namespace: Void.Minecraft.Network.Registries.Transformations.Properties
Assembly: Void.Minecraft.dll
Represents an unnamed binary NBT packet property.
public record NbtProperty : IPacketProperty<NbtProperty>, IPacketProperty, IEquatable<NbtProperty>Inheritance
Implements
IPacketProperty<NbtProperty>, IPacketProperty, IEquatable<NbtProperty>
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
NbtProperty(ReadOnlyMemory<byte>)
Represents an unnamed binary NBT packet property.
public NbtProperty(ReadOnlyMemory<byte> Value)Parameters
Value ReadOnlyMemory<byte>
The encoded unnamed NBT bytes, retained without copying or validation.
Properties
AsNbtTag
Gets a newly parsed NBT tag from the encoded bytes without reading a root name.
public NbtTag AsNbtTag { get; }Property Value
Value
The encoded unnamed NBT bytes, retained without copying or validation.
public ReadOnlyMemory<byte> Value { get; init; }Property Value
Methods
FromNbtTag(NbtTag)
Serializes a tag without its root name.
public static NbtProperty FromNbtTag(NbtTag value)Parameters
value NbtTag
The tag to serialize.
Returns
A property backed by the serialized bytes.
Read(ref MinecraftBuffer)
Reads one unnamed NBT tag and stores its normalized binary representation.
public static NbtProperty Read(ref MinecraftBuffer buffer)Parameters
buffer MinecraftBuffer
The source buffer.
Returns
The decoded property.
Write(ref MinecraftBuffer)
Parses and writes the NBT value without a root name.
public void Write(ref MinecraftBuffer buffer)Parameters
buffer MinecraftBuffer
The destination buffer.