Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

helix / defineBlockEntityNbt

Function: defineBlockEntityNbt() โ€‹

Call Signature โ€‹

defineBlockEntityNbt<F>(schema, blockEntityType): (fields) => IdentifiedBlockEntityNbt

Defined in: core/values/block-entity-nbt/define.ts:25

Builds a typed block-entity NBT factory from a field schema, for block entities helix doesn't cover:

const Crate = defineBlockEntityNbt<{ lock?: string }>({ lock: field({ key: "Lock" }), }, "mymod:crate");

Every vanilla block entity already has a factory (Chest, Sign, ...).

Type Parameters โ€‹

F โ€‹

F extends object

Parameters โ€‹

schema โ€‹

BlockEntityNbtSchema<F>

blockEntityType โ€‹

string

Returns โ€‹

(fields) => IdentifiedBlockEntityNbt

Call Signature โ€‹

defineBlockEntityNbt<F>(schema): (fields) => BlockEntityNbtValue

Defined in: core/values/block-entity-nbt/define.ts:29

Builds a typed block-entity NBT factory from a field schema, for block entities helix doesn't cover:

const Crate = defineBlockEntityNbt<{ lock?: string }>({ lock: field({ key: "Lock" }), }, "mymod:crate");

Every vanilla block entity already has a factory (Chest, Sign, ...).

Type Parameters โ€‹

F โ€‹

F extends object

Parameters โ€‹

schema โ€‹

BlockEntityNbtSchema<F>

Returns โ€‹

(fields) => BlockEntityNbtValue

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.