BlockAt type
The block a hook was called about. Reads are fields and acts are methods. The reads are **live** — the world as it is right now — and everything that changes the world is carried out by the engine the moment the hook returns, in the order it was asked for.
Functions 7
blockAt:get(face: Face) → string?The block one face away, by name; nil where that chunk is not in memory.
blockAt:set(block: BlockRef)Puts another block at this position.
blockAt:destroy()Takes it out, leaving nothing.
blockAt:become(entity: string, data: { [string]: any }?)**The door**: this block stops being a block, and that entity appears.
blockAt:drop(item: ItemSpec, count: number?)A name, or an item table: a pack item keeps its id.
blockAt:schedule()Asks for this block's on_tick, tick_every seconds from now.
blockAt:notify()Tells the six neighbours this block changed.
Fields 7
blockAt.data: DataViewWhat this block remembers beyond its state; kept with the position, saved with the chunk, and gone when the block goes. Nested writes are tracked; whole-record assignment is supported. Copy before keeping it beyond the hook.
blockAt.at: Vec3The block's position; a live read.
blockAt.name: stringThe block's name with its namespace, such as "rave:crate"; a live read.
blockAt.room: numberWhich room the block is in.
blockAt.state: numberWhich of this definition's states it is in, counting from 1. Writable, and bounds-checked against the definition's own looks list: it *is* the block state, so a crop's stages cost nothing.
blockAt.facing: Facing?A facing block's front: "north", "south", "west", "east"; nil otherwise. Writable.
blockAt.powered: boolean?Whether a redstone signal reaches it: what a lamp asks. A live read; nil where the chunk is not loaded.