function matrixToBlueprint(matrix, startCoord) {
    // Validate inputs
    if (!Array.isArray(matrix) || !Array.isArray(startCoord) || startCoord.length !== 3) {
        console.log(matrix)
        throw new Error('Invalid input format');
    }

    const [startX, startY, startZ] = startCoord;


    // CONSIDER: using blueprint class here?
    return {
        levels: matrix.map((level, levelIndex) => ({
            level: levelIndex,
            coordinates: [
                startX,
                startY + levelIndex,
                startZ
            ],
            placement: level.map(row =>
                // Ensure each block is a string, default to 'air' if undefined
                row.map(block => block?.toString() || 'air')
            )
        }))
    };
}
Converts a 3D matrix into a Minecraft blueprint format
@param {Array<Array<Array<string>>>} matrix - 3D matrix of block types
@param {number[]} startCoord - Starting coordinates [x, y, z]
@returns {Object} a Blueprint object in Minecraft format