Appearance
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 โ
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 โ
Returns โ
(fields) => BlockEntityNbtValue