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

    const blocks = [
        { name: 'andesite_alloy_block', material: 'rock', hardness: 2.0 },
        { name: 'holy_block', material: 'metal', hardness: 2.0 },
        { name: 'limestone_brick_runed', material: 'rock', hardness: 2.0, type: 'vertical' },
        { name: 'living_ceramic_black', material: 'rock', hardness: 2.0 },
        { name: 'blastbrick_steeled', material: 'rock', hardness: 3.0 },
        { name: 'beacon_core', material: 'metal', hardness: 5.0 },
        { name: 'titanium_ore', material: 'rock', hardness: 3.0, mineLevel: 4 },
        { name: 'chromium_ore', material: 'rock', hardness: 3.0, mineLevel: 4 },
        { name: 'stainless_steel_block', material: 'metal', hardness: 3.0 },
        { name: 'stainless_steel_sheetmetal', material: 'metal', hardness: 3.0 },
        { name: 'industrial_casing', material: 'metal', hardness: 3.0 },
        { name: 'dielectric_block', material: 'rock', hardness: 3.0 },
        { name: 'aquamarine_block', material: 'metal', hardness: 3.0 },
        { name: 'high_protein_fodder', material: 'dirt', hardness: 0.8 },
        { name: 'dimension_block', material: 'metal', hardness: 2.0 },
        { name: 'fluix_steel_block', material: 'metal', hardness: 3.0 },
        { name: 'fluix_steel_sheetmetal', material: 'metal', hardness: 3.0 }
    ];

    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);
        };

    })
    
})