Experimental

An early preview: docs, the API and the dashboard may change or break.

Report a problem
Typecontent.luau

BlockDef

A custom block, with an item that places it and that it drops unless it says otherwise. Each block may have at most 256 states (the product of its property sizes, behaviour properties included).

Fields

blockDef.behaviors: { Behavior }?
#

ready-made behaviours, applied in this order

blockDef.data: { [string]: any }?
#

per-block data, read with world.blockData: these defaults give its fields and types, as data.player's do; at most 4 KB of JSON per block

blockDef.drops: boolean?
#

with false it drops nothing; default its own item when broken (not by an explosion); a vanilla slab drops two when double

blockDef.hardness: number?
#

mining difficulty on vanilla's scale, 0 or more; default 2

blockDef.item: BlockItem?
#

its item's settings, or false for no item; default an item on paper, or with vanilla the vanilla block's item when it has one

blockDef.light: number?
#

light it gives off, 0..15; default 0

blockDef.model: BlockModel?
#

a model drawn over the donor for each state

blockDef.name: string?
#

the English name its item shows; omitted, an item with a model or a colour shows one read from the id (red_wool is "Red Wool")

blockDef.properties: { [string]: Property }?
#

extra properties by name, beyond those its behaviours add

blockDef.tool: BlockTool?
#

the tools that mine it faster

blockDef.unbreakable: boolean?
#

nobody can break it; overrides hardness

blockDef.vanilla: string?
#

the minecraft: block it is, such as "minecraft:oak_stairs": its states, shape behaviours, hardness, light, item and drops, each of which the other fields override

blockDef.visual: BlockVisual?
#

how the client draws it; give exactly one of visual and vanilla