import { BlockPermutation, system, world } from "@minecraft/server";
export class OnTickGrowComponent {
    constructor() {
        this.onTick = this.onTick.bind(this);
    }
    onTick(event) {
        const { block } = event;
        if (system.currentTick % 36000 <= 5) {
            const blockTypeId = block.typeId;
            if (blockTypeId.includes("orange")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/autumn/autumn_tree1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/autumn/autumn_tree2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/autumn/autumn_tree3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 3) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/autumn/autumn_tree4');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 4) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/autumn/autumn_tree5');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("enchanted")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/enchanted/enchanted_tree1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/enchanted/enchanted_tree2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/enchanted/enchanted_tree3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 3) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/enchanted/enchanted_tree4');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 4) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/enchanted/enchanted_tree5');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("horror")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/horror/horror_tree1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/horror/horror_tree2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/horror/horror_tree3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 3) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/horror/horror_tree4');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 4) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/horror/horror_tree5');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("lunar")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/lunar/lunarwood_tree1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/lunar/lunarwood_tree2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/lunar/lunarwood_tree3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 3) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/lunar/lunarwood_tree4');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 4) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/lunar/lunarwood_tree5');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("redwood")) {
                let randomNum = Math.round(Math.random() * 4);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/redwood/redwood_tree_1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/redwood/redwood_tree_2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/redwood/redwood_tree_3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 3) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/redwood/redwood_tree_4');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("sky")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/sky/sky_tree_1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/sky/sky_tree_2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/sky/sky_tree_3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 3) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/sky/sky_tree_4');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 4) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/sky/sky_tree_5');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("toxic")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/toxic/toxic_tree1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/toxic/toxic_tree2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/toxic/toxic_tree3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 3) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/toxic/toxic_tree4');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 4) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/toxic/toxic_tree5');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("red") && !blockTypeId.includes("redwood")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/whisper/whisper_tree1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/whisper/whisper_tree2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/whisper/whisper_tree3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 3) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/whisper/whisper_tree4');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 4) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/whisper/whisper_tree5');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("pink_mushroom")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/pink_mushroom_1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/pink_mushroom_2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/pink_mushroom_3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("blue_mushroom")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/blue_mushroom_1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/blue_mushroom_2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/blue_mushroom_3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("yellow_mushroom")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/yellow_mushroom_1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/yellow_mushroom_2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/yellow_mushroom_3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
            if (blockTypeId.includes("green_mushroom")) {
                let randomNum = Math.round(Math.random() * 5);
                if (randomNum == 0) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/green_mushroom_1');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 1) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/green_mushroom_2');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
                if (randomNum == 2) {
                    block.setType('minecraft:air');
                    const structure = world.structureManager.get('pu_biomes/trees/mushroom/green_mushroom_3');
                    if (!structure)
                        throw Error('Structure not found');
                    const size = structure.size;
                    const location = {
                        x: block.location.x - Math.round(size.x / 2) + 1,
                        y: block.location.y,
                        z: block.location.z - Math.round(size.z / 2) + 1,
                    };
                    world.structureManager.place(structure, block.dimension, location);
                }
            }
        }
    }
}
OnTickGrowComponent.id = 'pu_biomes:on_tick_grow';