export const event = {
    onTick(event) {
        const { block } = event;

        const currentStage = block.permutation.getState("sapphire_meteors:crack_bit");
        const newStage = currentStage + 1;

        if (currentStage !== 2) {
            const newPermutation = block.permutation.withState("sapphire_meteors:crack_bit", newStage);

            block.dimension.spawnParticle("minecraft:crop_growth_emitter", block.center());
            block.dimension.playSound("block.sniffer_egg.crack", block.location);
            block.setPermutation(newPermutation);
        }
        else {
            block.setType("minecraft:air");
            block.dimension.playSound("block.sniffer_egg.hatch", block.location);
            block.dimension.spawnEntity("sapphire_meteors:starspark", block.center());
        };
    }
};