ItemData

data class ItemData(val id: Identifier, val componentsNbt: CompoundTag)

Data for a single item to be synchronized. Contains the item id and its full DataComponentMap serialized as NBT.

Constructors

Link copied to clipboard
constructor(id: Identifier, componentsNbt: CompoundTag)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val componentsNbt: CompoundTag
Link copied to clipboard
val id: Identifier

Functions

Link copied to clipboard
fun decodeComponents(ops: DynamicOps<Tag>): DataComponentMap

Decodes the NBT back into a DataComponentMap. Uses NbtOps since we may not have full registry access on client during configuration.

Link copied to clipboard
fun write(buf: FriendlyByteBuf)