import * as mc from "@minecraft/server";

export class variantManager {
    static beforeplace(data) {
        const variant = getRandomInt(0,3);
        data.permutationToPlace = mc.BlockPermutation.resolve(data.permutationToPlace.type.id, {'sgs_cake:variant': variant});
    }
}

function getRandomInt(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1)) + min;
}