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

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:volcanic_rock_items_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:volcanic_rock_items'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:obsidian_items_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:obsidian_items'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:netherrack_items_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:netherrack_items'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:bloodstone_items_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:bloodstone_items'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:bloodstone_bricks_items_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:bloodstone_bricks_items'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:volcanic_rock_pigmans_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:ancient_zombie_pigman_brute_spawn'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:bloodstone_pigmans_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:ancient_zombie_pigman_spawn'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:obsidian_piglins_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:ancient_zombie_piglin_brute_spawn'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:netherrack_piglins_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:ancient_zombie_piglin_spawn'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:bloodstone_bricks_blaze_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:blaze_spawn'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:bloodstone_bricks_hovering_inferno_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:hovering_inferno_spawn'), block.location);
            block.setType('old_nether:bloodstone_bricks');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:bloodstone_bricks_vulcan_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:vulcan_spawn'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:bloodstone_bricks_lava_slime_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.spawnEntity(('old_nether:lava_slime_spawn'), block.location);
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:withered_fungus_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.runCommand(`execute if entity @e[r=16,family=monster] run effect @e[r=16,family=monster] wither 2 1`)
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:temporal_nexus_on_tick', {
        onTick: e => {
            const { block } = e;
            block.dimension.runCommand("say §cThe temporal nexus time is up!")
            block.dimension.runCommand("gamerule doDaylightCycle true")
            block.setType('old_nether:corrupted_volcanic_rock');
        }
    });
});

//Volcanic Rock Spire Function
world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:vr_reactor_function1_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:volcanic_rock_reactor_function2');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:vr_reactor_function2_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:volcanic_rock_reactor_function3');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:vr_reactor_function3_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:volcanic_rock_reactor_function4');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:vr_reactor_function4_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:volcanic_rock_reactor_function5');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:vr_reactor_function5_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.setType('old_nether:volcanic_rock_reactor_function6');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:vr_reactor_function6_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.setType('old_nether:volcanic_rock_reactor_function7');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:vr_reactor_function7_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            //Load Ancient Obsidian Spire
            block.dimension.runCommand(`structure load mystructure:volcanic_rock_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            //Setblock Glowing Obsidian -38
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -38 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -37
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -37 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -36
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -36 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z} old_nether:reactor3_obsidian_ruby`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:vr_reactor_function_disable_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`structure load mystructure:volcanic_rock_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});

//Bloodstone Spire Function
world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:b_reactor_function1_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:bloodstone_reactor_function2');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:b_reactor_function2_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:bloodstone_reactor_function3');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:b_reactor_function3_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:bloodstone_reactor_function4');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:b_reactor_function4_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:bloodstone_reactor_function5');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:b_reactor_function5_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.setType('old_nether:bloodstone_reactor_function6');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:b_reactor_function6_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.setType('old_nether:bloodstone_reactor_function7');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:b_reactor_function7_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            //Load Bloodstone Spire
            block.dimension.runCommand(`structure load mystructure:bloodstone_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            //Setblock Glowing Obsidian -38
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -38 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -37
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -37 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -36
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -36 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z} old_nether:reactor3_ruby`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:b_reactor_function_disable_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`structure load mystructure:bloodstone_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});

//Netherrack Spire Function
world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:n_reactor_function1_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:netherrack_reactor_function2');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:n_reactor_function2_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:netherrack_reactor_function3');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:n_reactor_function3_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:netherrack_reactor_function4');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:n_reactor_function4_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:netherrack_reactor_function5');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:n_reactor_function5_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} obsidian`)
            block.setType('old_nether:netherrack_reactor_function6');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:n_reactor_function6_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} obsidian`)
            block.setType('old_nether:netherrack_reactor_function7');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:n_reactor_function7_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            //Load Netherrack Spire
            block.dimension.runCommand(`structure load mystructure:netherrack_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            //Setblock Glowing Obsidian -38
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} obsidian`)
            //Setblock Glowing Obsidian -38 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} obsidian`)
            //Setblock Glowing Obsidian -37
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} obsidian`)
            //Setblock Glowing Obsidian -37 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} obsidian`)
            //Setblock Glowing Obsidian -36
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} obsidian`)
            //Setblock Glowing Obsidian -36 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z} old_nether:reactor3`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:n_reactor_function_disable_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`structure load mystructure:netherrack_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});

//Obsidian Spire Function
world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:o_reactor_function1_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:obsidian_reactor_function2');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:o_reactor_function2_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:obsidian_reactor_function3');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:o_reactor_function3_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:obsidian_reactor_function4');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:o_reactor_function4_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:obsidian_reactor_function5');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:o_reactor_function5_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} obsidian`)
            block.setType('old_nether:obsidian_reactor_function6');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:o_reactor_function6_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} obsidian`)
            block.setType('old_nether:obsidian_reactor_function7');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:o_reactor_function7_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            //Load Obsidian Spire
            block.dimension.runCommand(`structure load mystructure:obsidian_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            //Setblock Glowing Obsidian -38
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} obsidian`)
            //Setblock Glowing Obsidian -38 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} obsidian`)
            //Setblock Glowing Obsidian -37
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} obsidian`)
            //Setblock Glowing Obsidian -37 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} obsidian`)
            //Setblock Glowing Obsidian -36
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} obsidian`)
            //Setblock Glowing Obsidian -36 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z} old_nether:reactor3_obsidian`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:o_reactor_function_disable_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`structure load mystructure:obsidian_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});

//Inferno Spire Function
world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function1_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:inferno_reactor_function2');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function2_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:inferno_reactor_function3');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function3_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:glowing_obsidian`)
            block.setType('old_nether:inferno_reactor_function4');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function4_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} old_nether:glowing_obsidian`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} old_nether:glowing_obsidian`)
            block.setType('old_nether:inferno_reactor_function5');
        }
    });
});
world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function5_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`structure load mystructure:inferno_spire2 ${x - 8} ${y - 39} ${z - 8}`)
            block.setType('old_nether:inferno_reactor_function6');
        }
    });
});
world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function6_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`structure load mystructure:inferno_spire3 ${x - 8} ${y - 39} ${z - 8}`)
            block.setType('old_nether:inferno_reactor_function7');
        }
    });
});
world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function7_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`structure load mystructure:inferno_spire4 ${x - 8} ${y - 39} ${z - 8}`)
            block.setType('old_nether:inferno_reactor_function8');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function8_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.setType('old_nether:inferno_reactor_function9');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function9_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.setType('old_nether:inferno_reactor_function10');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function10_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            //Load Obsidian Spire
            block.dimension.runCommand(`structure load mystructure:inferno_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            //Setblock Glowing Obsidian -38
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 38} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -38 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 38} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 38} ${z - 1} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -37
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -37 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 37} ${z - 1} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -36
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z} old_nether:volcanic_rock`)
            //Setblock Glowing Obsidian -36 + = -
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x + 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z + 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x - 1} ${y - 36} ${z - 1} old_nether:volcanic_rock`)
            block.dimension.runCommand(`setblock ${x} ${y - 37} ${z} old_nether:reactor3_inferno`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});

world.beforeEvents.worldInitialize.subscribe(initEvent => {
    initEvent.blockComponentRegistry.registerCustomComponent('old_nether:i_reactor_function_disable_on_tick', {
        onTick: e => {
            const { block } = e;
            const { x, y, z } = block.location
            block.dimension.runCommand(`structure load mystructure:inferno_spire_destroy ${x - 8} ${y - 39} ${z - 8}`)
            block.dimension.runCommand("playsound reactor.desactivate @a[r=16]")
            block.setType('minecraft:air');
        }
    });
});