Slabs Library
The builtin:slabdef library gives helpers for registering slab variants of regular blocks.
Importing
Functions
Function: slabdef.on_place(identifier) -> function
This function returns an on_place callback for a given slab identifier.
Arguments
identifieris the namespaced block ID. If you omit the namespace, the engine usescore.NAMESPACE.
Return value
- A function that implements slab placement logic for block registration
Function: slabdef.add_block(identifier, prototype, options) -> integer
A wrapper around blocks.add that defines a slab block family.
Arguments
identifieris the namespaced block ID. If you omit the namespace, the engine usescore.NAMESPACE.prototypeis the base block definition the function builds onoptionsis an optional table with extra parameters
Return value
- Numeric block ID
Notes
- The registered block family gets an
orientationstate and variants fortop,bottom, anddouble. - The function keeps the touch response values from the prototype unchanged. It only defines block collisions.