ForgeEvents.onEvent('net.minecraftforge.event.level.BlockEvent$NeighborNotifyEvent', event => {
    let block = event.state.block
    if (block.id !== 'minecraft:lava') return;
    for (let dir of event.notifiedSides) {
        const pos = event.pos.relative(dir);
        const target = event.level.getBlockState(pos);
        if (target.is('kubejs:soggy_carpet')) {
            event.level.setBlock(pos, Block.getBlock('kubejs:carpet').defaultBlockState(), 3);
            doCommandForBlock(event.level.server, `/execute positioned ${pos.x} ${pos.y} ${pos.z} run playsound minecraft:block.lava.pop block @a ~ ~ ~ 0.5 0.75`)
            break;
        }
    }
});

ForgeEvents.onEvent('net.minecraftforge.event.level.BlockEvent$NeighborNotifyEvent', event => {
    let block = event.state.block
    if (block.id !== 'minecraft:lava') return;
    for (let dir of event.notifiedSides) {
        const pos = event.pos.relative(dir);
        const target = event.level.getBlockState(pos);
        if (target.is('kubejs:soggy_carpet_stairs')) {
            event.level.setBlock(pos, Block.getBlock('kubejs:carpet_stairs').defaultBlockState(), 3);
            doCommandForBlock(event.level.server, `/execute positioned ${pos.x} ${pos.y} ${pos.z} run playsound minecraft:block.lava.pop block @a ~ ~ ~ 0.5 0.75`)
            break;
        }
    }
});

ForgeEvents.onEvent('net.minecraftforge.event.level.BlockEvent$NeighborNotifyEvent', event => {
    let block = event.state.block
    if (block.id !== 'minecraft:lava') return;
    for (let dir of event.notifiedSides) {
        const pos = event.pos.relative(dir);
        const target = event.level.getBlockState(pos);
        if (target.is('kubejs:soggy_carpet_slab')) {
            event.level.setBlock(pos, Block.getBlock('kubejs:carpet_slab').defaultBlockState(), 3);
            doCommandForBlock(event.level.server, `/execute positioned ${pos.x} ${pos.y} ${pos.z} run playsound minecraft:block.lava.pop block @a ~ ~ ~ 0.5 0.75`)
            break;
        }
    }
});