Blockbench Reference Docs
    Preparing search index...

    Interface CubeSizeLimiter

    interface CubeSizeLimiter {
        clamp: (
            cube: Cube,
            values?: { from: ArrayVector3; inflate: number; to: ArrayVector3 },
            axis?: number,
            direction?: boolean,
        ) => void;
        coordinate_limits?: [number, number];
        rotation_affected?: boolean;
        test: (
            cube: Cube,
            values?: { from: ArrayVector3; inflate: number; to: ArrayVector3 },
        ) => boolean;
        move(
            cube: Cube,
            values?: { from: ArrayVector3; inflate: number; to: ArrayVector3 },
        ): void;
    }
    Index

    Properties

    clamp: (
        cube: Cube,
        values?: { from: ArrayVector3; inflate: number; to: ArrayVector3 },
        axis?: number,
        direction?: boolean,
    ) => void

    Clamp the cube to fit into the restrictions. When an axis and direction is provided, clamp the element on that side to prevent wandering.

    coordinate_limits?: [number, number]

    Optionally set the coordinate limits of cubes in local space

    rotation_affected?: boolean

    Set to true to tell Blockbench to check and adjust the cube limit after rotating a cube

    test: (
        cube: Cube,
        values?: { from: ArrayVector3; inflate: number; to: ArrayVector3 },
    ) => boolean

    Test whether the cube with the optionally provided values violates the size restrictions

    Methods

    • Move the cube back into the restructions

      Parameters

      Returns void