onEvent('block.registry', event => {

    const blocks = [
        { name: 'andesite_alloy_block', material: 'rock', hardness: 2.0 },
        { name: 'limestone_brick_runed', material: 'rock', hardness: 2.0, type: 'vertical' },
        { name: 'living_ceramic_black', material: 'rock', hardness: 2.0 },
        { name: 'industrial_casing', material: 'metal', hardness: 3.0 },
        { name: 'dielectric_block', material: 'rock', hardness: 3.0 },
        { name: 'high_protein_fodder', material: 'dirt', hardness: 0.8 }
    ];

    blocks.forEach(block => {

        const block_event = event.create(block.name).material(block.material).hardness(block.hardness);
        if(block.resistance) {
            block_event.resistance(block.resistance);
        };
        if(block.type == 'vertical') {
            const direction1 = ['south', 'north', 'east', 'west'];
            const direction2 = ['up', 'down'];
            direction1.forEach(direction => {
                block_event.texture(direction, `kubejs:block/${block.name}_1`);
            });
            direction2.forEach(direction => {
                block_event.texture(direction, `kubejs:block/${block.name}_2`);
            });
        };
        if(block.mineLevel){
            block_event.harvestTool('pickaxe', block.mineLevel);
        };

    })
    
})