import { world } from '@minecraft/server';

const check_block = {
    onTick(event) {
        const block = event.block;
        if (block.below().typeId != "furnideco:rustic.fire_pit") {
            block.setType("minecraft:air");
        }
    }
};

world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry }) => {
    blockComponentRegistry.registerCustomComponent(
        "furnideco:check_block",
        check_block
    );
});