Skip to content

API reference Obsidian.API.Inventory

DataComponent record

An immutable item component. Replace it on the stack to change its value.

public abstract record DataComponent : IEquatable<DataComponent>

In Obsidian.API.

Constructors

protected DataComponent();

Properties

public abstract string Identifier { get; }public abstract DataComponentType Type { get; }

Methods

Read(INetStreamReader)

public DataComponent Read(INetStreamReader reader);

Reads a new value without changing this component.

ReadCore(INetStreamReader)

protected virtual void ReadCore(INetStreamReader reader);

Decodes into the new, unpublished copy created by DataComponent.Read.

Remarks

Replace fields rather than mutating references shared with the original value.

public virtual void Write(INetStreamWriter writer);

On this page