import { world, ItemStack, system, BlockPermutation } from "@minecraft/server";
import { ActionFormData } from "@minecraft/server-ui";

var namespace = "rzb_dcocrfnt";
var rl = (path) => {
    return `${namespace}:${path}`;
};
var propertyName = rl("save_data");

function getSaveData(player) {
    let props = player.getDynamicProperty(propertyName);
    if (typeof props === "string") {
        return getSaveDataWithDefaults(JSON.parse(props));
    }
    return { givenBook: false, viewedPages: [] };
}
function setSaveData(player, data) {
    player.setDynamicProperty(propertyName, JSON.stringify(data));
}
function getSaveDataWithDefaults(data) {
    return {
        givenBook: data.givenBook,
        viewedPages: data.viewedPages ?? [],
    };
}

var Book = class {
    pages = {};
    trackPages;
    constructor(index, trackPages = true) {
        this.trackPages = trackPages;
        this.addPage("index", index);
    }
    addPage(name, page) {
        this.pages[name] = page;
    }
    async openBook(params) {
        await this.openPage("index", params);
    }
    async openPage(page, params) {
        if (this.trackPages) {
            let saveData = getSaveData(params.player);
            if (!saveData.viewedPages.includes(page)) {
                saveData.viewedPages.push(page);
                setSaveData(params.player, saveData);
            }
        }
        params.currentPage = page;
        await this.pages[page].show({
            book: this,
            player: params.player,
            ...params,
        });
    }
};

var Page = class {
    type;
    _title;
    constructor({ type, title }) {
        this.type = type;
        this._title = this.state(title);
    }
    title(params) {
        return this._title(params);
    }
    state(thing) {
        return typeof thing === "function" ? thing : () => thing;
    }
};
var ActionPage = class extends Page {
    _body;
    _buttons;
    constructor({ title, body, buttons }) {
        super({ type: "action", title });
        this._body = this.state(body);
        this._buttons = this.state(buttons);
    }
    async show(params) {
        const form = new ActionFormData()
            .title(this.title(params))
            .body(this.body(params));
        const hydratedButtons = this.buttons(params);
        hydratedButtons.forEach((value) => value.attach(form));
        const response = await form.show(params.player);
        if (!response.canceled && response.selection !== void 0) {
            const element = hydratedButtons[response.selection];
            if (element) {
                await element.submit(params);
            }
        }
    }
    body(params) {
        return this._body(params);
    }
    buttons(params) {
        return this._buttons(params);
    }
};
var handleAction = async (params, action) => {
    if (action) {
        const subAction = await action(params);
        if (subAction) {
            await handleAction(params, subAction);
        }
    }
};

var Button = class {
    text;
    action;
    constructor({ text, action }) {
        this.text = text;
        this.action = action;
    }
    attach(page) {
        if (page instanceof ActionFormData) {
            page.button(this.text);
        }
    }
    async submit(params) {
        if (this.action) {
            await handleAction(params, this.action);
        }
    }
};
var IconButton = class {
    text;
    icon;
    action;
    constructor({ text, icon, action }) {
        this.text = text;
        this.action = action;
        this.icon = icon;
    }
    attach(page) {
        if (page instanceof ActionFormData) {
            page.button(this.text, this.icon);
        }
    }
    async submit(params) {
        if (this.action) {
            await handleAction(params, this.action);
        }
    }
};
var bookItemId = rl("guide_book");                          // --> Esta variable NO se ha utilizado
var nextButtonKey = `guidebook.${namespace}.button.next`;   // --> Esta variable NO se ha utilizado
var backButtonKey = `guidebook.${namespace}.button.back`;
var firstPage = "index";
var initGuideBook = () => {
    const guideBook = createGuideBook();

    world.afterEvents.itemUse.subscribe(async ({ itemStack, source }) => {
        if (itemStack.typeId === "rzb_dcocrfnt:guide_book") {                        
            await guideBook.openBook({ player: source });
        }
    });

    world.afterEvents.playerSpawn.subscribe(async (event) => {
        let saveData = getSaveData(event.player);
        if (!saveData.givenBook) {
            event.player.dimension.spawnItem(
                new ItemStack(rl("guide_book"), 1),
                event.player.location
            );
            setSaveData(event.player, { ...saveData, givenBook: true });
        }
    });
};

function createGuideBook() {
    const index = new LinkablePage(firstPage);
    const tutorial = new LinkablePage("tutorial", index);                   // OJO! El primer argumento (en este caso "tutorial") sirve para decidir 2 cosas:    1. Qué icono se mostrará junto al botón.    2. Qué textos del en_US.lang serán mostrados
    const tutobiomat = new LinkablePage("tuto_biomat", tutorial);        
    const tutosproutingtable = new LinkablePage("tuto_sproutingtable", tutorial);
    const tutosproutingtableFuel = new CraftingPage("tuto_sproutingtable", tutosproutingtable);
/*    const sproutingtableFuel = new LinkablePage("sproutingtable_fuel", tutosproutingtable);               BORRADO
    const sproutingtableInput = new LinkablePage("sproutingtable_input", tutosproutingtable);
    const sproutingtableOutput = new LinkablePage("sproutingtable_output", tutosproutingtable);     */
    const tutonaturebench = new LinkablePage("tuto_naturebench", tutorial);
    const naturebenchRecipe = new CraftingPage("tuto_naturebench", tutonaturebench);
/*    const naturebenchInput = new LinkablePage("naturebench_input", tutonaturebench);               BORRADO
    const naturebenchOutput = new LinkablePage("naturebench_output", tutonaturebench);
    const naturebenchDecorations = new LinkablePage("naturebench_decorations", tutonaturebench);        */
    const tutoDecobrush = new LinkablePage("tuto_decobrush", tutorial);
    const tutoDecobrushRecipe = new CraftingPage("tuto_decobrush", tutoDecobrush);
    const tutoWarning = new LinkablePage("tuto_warning", tutorial);
    const credits = new LinkablePage("credits", index);

    const book = new Book(
        index.actionPage((ctx) => [
            tutorial.pageLinkButton(ctx),
            credits.pageLinkButton(ctx),
        ]),
        true
    );
    tutorial.addActionPage(book, (ctx) => {
        let buttons = [
            tutobiomat.pageLinkButton(ctx),
            tutosproutingtable.pageLinkButton(ctx),
            tutonaturebench.pageLinkButton(ctx),
            tutoDecobrush.pageLinkButton(ctx),
            tutoWarning.pageLinkButton(ctx),
        ];
        buttons.push(tutorial.backButton());
        return buttons;
    });
    tutobiomat.addActionPage(book, (ctx) => [
        tutosproutingtable.nextPageButton(ctx),
        tutobiomat.backButton(),
    ]);
    tutosproutingtable.addActionPage(book, (ctx) => [
        tutosproutingtableFuel.pageLinkButton(ctx),
/*        sproutingtableFuel.pageLinkButton(ctx),               BORRADO
        sproutingtableInput.pageLinkButton(ctx),
        sproutingtableOutput.pageLinkButton(ctx),     */
        tutonaturebench.nextPageButton(ctx),
        tutosproutingtable.backButton(),
    ]);
    tutosproutingtableFuel.addActionPage(book);
/*    sproutingtableFuel.addActionPage(book);
    sproutingtableInput.addActionPage(book);
    sproutingtableOutput.addActionPage(book);       */
    tutonaturebench.addActionPage(book, (ctx) => [
        naturebenchRecipe.pageLinkButton(ctx),
/*        naturebenchInput.pageLinkButton(ctx),               BORRADO
        naturebenchOutput.pageLinkButton(ctx),
        naturebenchDecorations.pageLinkButton(ctx),     */
        tutoDecobrush.nextPageButton(ctx),
        tutonaturebench.backButton(),
    ]);
    naturebenchRecipe.addActionPage(book);
/*    naturebenchInput.addActionPage(book);               BORRADO
    naturebenchOutput.addActionPage(book);
    naturebenchDecorations.addActionPage(book);     */
    tutoDecobrush.addActionPage(book, (ctx) => [
        tutoDecobrushRecipe.pageLinkButton(ctx),
        tutoWarning.nextPageButton(ctx),
        tutoDecobrush.backButton(),
    ]);
    tutoDecobrushRecipe.addActionPage(book);
    tutoWarning.addActionPage(book, (ctx) => [
        tutoWarning.backButton(),
    ]);
    credits.addActionPage(book);
    return book;
}

var LinkablePage = class {
    parent;
    pageId;
    constructor(pageId, parent) {
        this.pageId = pageId;
        this.parent = parent;
    }
    localize(type) {
        return `guidebook.${namespace}.${this.pageId}.${type}`;
    }
    titleKey() {
        return this.localize("title");
    }
    bodyKey() {
        return this.localize("body");
    }
    backButton() {
        const btnText = this.parent
            ? {
                translate: `guidebook.${namespace}.button.back_page`,
                with: {
                    rawtext: [
                        { translate: this.parent ? this.parent.titleKey() : `error` },
                    ],
                },
            }
            : { translate: backButtonKey };
        return new Button({
            text: btnText,
            action: async (params) => {
                if (this.parent) {
                    params.book.openPage(this.parent.pageId, params);
                }
            },
        });
    }
    addActionPage(book, buttons = (ctx) => [this.backButton()]) {
        book.addPage(this.pageId, this.actionPage(buttons));
    }
    actionPage(buttons) {
        return new ActionPage({
            title: { translate: this.titleKey() },
            body: { translate: this.bodyKey(), with: ["\n", "\n\n"] },
            buttons,
        });
    }
    getIconPath(player, displayUnread = true) {
        return `textures/rb/dcn/guide_book/${this.pageId}${displayUnread && !hasPlayerReadPage(player, this.pageId) ? "_new" : ""
            }`;
    }
    nextPageButton(ctx, displayUnread = true) {
        return new IconButton({
            text: {
                translate: `guidebook.${namespace}.button.next`,
                with: { rawtext: [{ translate: this.titleKey() }] },
            },
            icon: this.getIconPath(ctx.player, displayUnread),
            action: async (params) => params.book.openPage(this.pageId, params),
        });
    }
    pageLinkButton(ctx, displayUnread = true) {
        return new IconButton({
            text: { translate: this.titleKey() },
            icon: this.getIconPath(ctx.player, displayUnread),
            action: async (params) => params.book.openPage(this.pageId, params),
        });
    }
};
var CraftingPage = class extends LinkablePage {
    constructor(pageId, parent, prefix = "craft") {
        super(`${prefix}_${pageId}`, parent);
    }
    titleKey() {
        return `guidebook.${namespace}.page.crafting`;
    }
};

function hasPlayerReadPage(player, pageId) {
    return getSaveData(player).viewedPages.includes(pageId);
}

initGuideBook();


export function getScore(target, obj) {
  try {
      const oB = world.scoreboard.getObjective(obj)
      return oB.getScore(typeof target == 'string' ? oB.getParticipants().find(pT => pT.displayName == target) : oB.getScore(target.scoreboard))
  } catch {
      return NaN
  }
};
export function setScore(target, obj, value) {
  try {
      const oB = world.scoreboard.getObjective(obj);
      oB.setScore(target, value);
      return getScore(target, obj);
  } catch {
      return NaN
  }
};
system.afterEvents.scriptEventReceive.subscribe(({ id, sourceEntity }) => {
    if (id === 'rzb_dcocrfnt:newslotsamount_seeds') {
        const amount = sourceEntity.getProperty("rzb_dcocrfnt:amount");
        const toraw = Math.floor(amount / 8);
        setScore("rzb_dcocrfnt:bio_materials_cr", "rzb_dcocrfnt:jig_computer.addon_stats", getScore("rzb_dcocrfnt:bio_materials_cr", "rzb_dcocrfnt:jig_computer.addon_stats") + toraw);
        for (let entity of world.getDimension("overworld").getEntities({ location: sourceEntity.location, type: 'rzb_dcocrfnt:sprttable_slot_out', closest: 1 })) {
            entity.setProperty("rzb_dcocrfnt:amount", toraw);
            // Introducimos un pequeño retraso
            system.runTimeout(() => {
                const entityAmount = entity.getProperty("rzb_dcocrfnt:amount");                
                const slotin_decrease = entityAmount * 8;
                const slotin_newvalue = amount - slotin_decrease;
                sourceEntity.setProperty("rzb_dcocrfnt:amount", slotin_newvalue);
                setScore("rzb_dcocrfnt:dirt_sprouted_", "rzb_dcocrfnt:jig_computer.addon_stats", getScore("rzb_dcocrfnt:dirt_sprouted_", "rzb_dcocrfnt:jig_computer.addon_stats") + slotin_decrease);
            }, 1);
        }
    }
    if (id === 'rzb_dcocrfnt:newslotsamount_cobble') {
        const amount = sourceEntity.getProperty("rzb_dcocrfnt:amount");
        const toraw = Math.floor(amount / 4);
        setScore("rzb_dcocrfnt:bio_materials_cr", "rzb_dcocrfnt:jig_computer.addon_stats", getScore("rzb_dcocrfnt:bio_materials_cr", "rzb_dcocrfnt:jig_computer.addon_stats") + toraw);
        for (let entity of world.getDimension("overworld").getEntities({ location: sourceEntity.location, type: 'rzb_dcocrfnt:sprttable_slot_out', closest: 1 })) {
            entity.setProperty("rzb_dcocrfnt:amount", toraw);
            system.runTimeout(() => {
                const entityAmount = entity.getProperty("rzb_dcocrfnt:amount");                
                const slotin_decrease = entityAmount * 4;
                const slotin_newvalue = amount - slotin_decrease;
                sourceEntity.setProperty("rzb_dcocrfnt:amount", slotin_newvalue);
                setScore("rzb_dcocrfnt:cobblestone_deco", "rzb_dcocrfnt:jig_computer.addon_stats", getScore("rzb_dcocrfnt:cobblestone_deco", "rzb_dcocrfnt:jig_computer.addon_stats") + slotin_decrease);
            }, 1);
        }
    }
    if (id === 'rzb_dcocrfnt:newslotsamount_wood') {
        const amount = sourceEntity.getProperty("rzb_dcocrfnt:amount");
        const toraw = Math.floor(amount / 2);
        setScore("rzb_dcocrfnt:bio_materials_cr", "rzb_dcocrfnt:jig_computer.addon_stats", getScore("rzb_dcocrfnt:bio_materials_cr", "rzb_dcocrfnt:jig_computer.addon_stats") + toraw);
        for (let entity of world.getDimension("overworld").getEntities({ location: sourceEntity.location, type: 'rzb_dcocrfnt:sprttable_slot_out', closest: 1 })) {
            entity.setProperty("rzb_dcocrfnt:amount", toraw);
            system.runTimeout(() => {
                const entityAmount = entity.getProperty("rzb_dcocrfnt:amount");                
                const slotin_decrease = entityAmount * 2;
                const slotin_newvalue = amount - slotin_decrease;
                sourceEntity.setProperty("rzb_dcocrfnt:amount", slotin_newvalue);
                setScore("rzb_dcocrfnt:logs_sprouted_", "rzb_dcocrfnt:jig_computer.addon_stats", getScore("rzb_dcocrfnt:logs_sprouted_", "rzb_dcocrfnt:jig_computer.addon_stats") + slotin_decrease);
            }, 1);
        }
    }
});

function checkAndSetCooldown(player, cooldownDuration) {
    const tick = system.currentTick;
    const playerCooldown = player.cooldown1 ?? tick;
    if (playerCooldown - tick > 0) {
      return false;
    }
    player.cooldown1 = tick + cooldownDuration;
    return true;
}

const soundOptions1 = {
    volume: 1.0
};
const soundOptions2 = {
    volume: 0.5
};
const soundOptions3 = {
    volume: 0.85
};

// Clipping blocks RIGHT

world.beforeEvents.playerInteractWithBlock.subscribe((data) => {
    const {player, itemStack, block} = data;
    const blockState = block.permutation.getState("rzb_dcocrfnt:variation");
    const blockOrientation = block.permutation.getState("minecraft:cardinal_direction");

    if(itemStack?.typeId == "rzb_dcocrfnt:hedge_clipper") {
        
        // Vars blocks

        const blockVariations = {
            "rzb_dcocrfnt:deco_s11_p1_12_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s11_p1_16_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s11_p1_20_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s11_p1_24_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_01_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_03_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_04_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_06_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_07_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_09_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_10_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_12_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_13_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s2_p1_15_vars": [0, 1, 2],
            "rzb_dcocrfnt:deco_s11_p1_14_vars": [0, 1, 2, 3],
            "rzb_dcocrfnt:deco_s11_p1_15_vars": [0, 1, 2, 3],
            "rzb_dcocrfnt:deco_s11_p1_18_vars": [0, 1, 2, 3],
            "rzb_dcocrfnt:deco_s11_p1_19_vars": [0, 1, 2, 3],
            "rzb_dcocrfnt:deco_s11_p1_22_vars": [0, 1, 2, 3],
            "rzb_dcocrfnt:deco_s11_p1_23_vars": [0, 1, 2, 3],
            "rzb_dcocrfnt:deco_s11_p1_26_vars": [0, 1, 2, 3],
            "rzb_dcocrfnt:deco_s11_p1_27_vars": [0, 1, 2, 3],
            "rzb_dcocrfnt:deco_s11_p1_08_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s11_p1_09_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s11_p1_10_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s11_p1_11_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s11_p1_13_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s11_p1_17_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s11_p1_21_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s11_p1_25_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s5_p1_13_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s5_p1_14_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s5_p1_15_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s5_p1_16_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s5_p1_17_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s5_p1_18_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s5_p1_19_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s5_p1_20_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s5_p1_21_vars": [0, 1, 2, 3, 4],
            "rzb_dcocrfnt:deco_s2_p1_26_vars": [0, 1, 2, 3, 4, 5],
            "rzb_dcocrfnt:deco_s2_p2_02_vars": [0, 1, 2, 3, 4, 5],
            "rzb_dcocrfnt:deco_s2_p2_06_vars": [0, 1, 2, 3, 4, 5],
            "rzb_dcocrfnt:deco_s2_p2_10_vars": [0, 1, 2, 3, 4, 5],
            "rzb_dcocrfnt:deco_s2_p2_14_vars": [0, 1, 2, 3, 4, 5],
            "rzb_dcocrfnt:deco_s2_p1_02_vars": [0, 1, 2, 3, 4, 5, 6],
            "rzb_dcocrfnt:deco_s2_p1_05_vars": [0, 1, 2, 3, 4, 5, 6],
            "rzb_dcocrfnt:deco_s2_p1_08_vars": [0, 1, 2, 3, 4, 5, 6],
            "rzb_dcocrfnt:deco_s2_p1_11_vars": [0, 1, 2, 3, 4, 5, 6],
            "rzb_dcocrfnt:deco_s2_p1_14_vars": [0, 1, 2, 3, 4, 5, 6],
            "rzb_dcocrfnt:deco_s5_p1_01_vars": [0, 1, 2, 3, 4, 5, 6, 7],
            "rzb_dcocrfnt:deco_s5_p1_02_vars": [0, 1, 2, 3, 4, 5, 6, 7],
            "rzb_dcocrfnt:deco_s5_p1_03_vars": [0, 1, 2, 3, 4, 5, 6, 7],
            "rzb_dcocrfnt:deco_s5_p1_04_vars": [0, 1, 2, 3, 4, 5, 6, 7],
            "rzb_dcocrfnt:deco_s5_p1_05_vars": [0, 1, 2, 3, 4, 5, 6, 7],
        };
        const blockVariation = blockVariations[block.typeId];
        if (blockVariation) {
            system.runTimeout(() => {
                if (!checkAndSetCooldown(player,4)) return;
                player.playAnimation('animation.rzb_dcocrfnt.player.interact');
                world.playSound("mob.sheep.shear", block.location, soundOptions1);
                world.playSound("block.beehive.shear", block.location, soundOptions2);
                const nextVariation = (blockState + 1) % blockVariation.length;
                block.setPermutation(block.permutation.withState("rzb_dcocrfnt:variation", nextVariation));
            }, 1);
        }

        // Indvar blocks

        const blockTransitions = {
            "rzb_dcocrfnt:deco_s1_p1_01": "rzb_dcocrfnt:deco_s1_p1_02",
            "rzb_dcocrfnt:deco_s1_p1_02": "rzb_dcocrfnt:deco_s1_p1_03",
            "rzb_dcocrfnt:deco_s1_p1_03": "rzb_dcocrfnt:deco_s1_p1_04",
            "rzb_dcocrfnt:deco_s1_p1_04": "rzb_dcocrfnt:deco_s1_p1_01",

            "rzb_dcocrfnt:deco_s1_p1_05": "rzb_dcocrfnt:deco_s1_p1_06",
            "rzb_dcocrfnt:deco_s1_p1_06": "rzb_dcocrfnt:deco_s1_p1_07",
            "rzb_dcocrfnt:deco_s1_p1_07": "rzb_dcocrfnt:deco_s1_p1_05",
            
            "rzb_dcocrfnt:deco_s1_p1_10": "rzb_dcocrfnt:deco_s1_p1_11",
            "rzb_dcocrfnt:deco_s1_p1_11": "rzb_dcocrfnt:deco_s1_p1_12",
            "rzb_dcocrfnt:deco_s1_p1_12": "rzb_dcocrfnt:deco_s1_p1_10",

            "rzb_dcocrfnt:deco_s1_p1_13": "rzb_dcocrfnt:deco_s1_p1_14",
            "rzb_dcocrfnt:deco_s1_p1_14": "rzb_dcocrfnt:deco_s1_p1_15",
            "rzb_dcocrfnt:deco_s1_p1_15": "rzb_dcocrfnt:deco_s1_p1_13",

            "rzb_dcocrfnt:deco_s1_p1_16": "rzb_dcocrfnt:deco_s1_p1_17",
            "rzb_dcocrfnt:deco_s1_p1_17": "rzb_dcocrfnt:deco_s1_p1_16",

            "rzb_dcocrfnt:deco_s1_p1_18": "rzb_dcocrfnt:deco_s1_p1_19",
            "rzb_dcocrfnt:deco_s1_p1_19": "rzb_dcocrfnt:deco_s1_p1_18",

            "rzb_dcocrfnt:deco_s1_p1_20": "rzb_dcocrfnt:deco_s1_p1_21",
            "rzb_dcocrfnt:deco_s1_p1_21": "rzb_dcocrfnt:deco_s1_p1_20",

            "rzb_dcocrfnt:deco_s2_p1_16": "rzb_dcocrfnt:deco_s2_p1_17",
            "rzb_dcocrfnt:deco_s2_p1_17": "rzb_dcocrfnt:deco_s2_p1_16",

            "rzb_dcocrfnt:deco_s2_p1_18": "rzb_dcocrfnt:deco_s2_p1_19",
            "rzb_dcocrfnt:deco_s2_p1_19": "rzb_dcocrfnt:deco_s2_p1_18",

            "rzb_dcocrfnt:deco_s2_p1_20": "rzb_dcocrfnt:deco_s2_p1_21",
            "rzb_dcocrfnt:deco_s2_p1_21": "rzb_dcocrfnt:deco_s2_p1_20",

            "rzb_dcocrfnt:deco_s2_p1_22": "rzb_dcocrfnt:deco_s2_p1_23",
            "rzb_dcocrfnt:deco_s2_p1_23": "rzb_dcocrfnt:deco_s2_p1_22",

            "rzb_dcocrfnt:deco_s2_p1_24": "rzb_dcocrfnt:deco_s2_p1_25",
            "rzb_dcocrfnt:deco_s2_p1_25": "rzb_dcocrfnt:deco_s2_p1_24",

            "rzb_dcocrfnt:deco_s3_p1_01": "rzb_dcocrfnt:deco_s3_p1_02",
            "rzb_dcocrfnt:deco_s3_p1_02": "rzb_dcocrfnt:deco_s3_p1_01",

            "rzb_dcocrfnt:deco_s3_p1_03": "rzb_dcocrfnt:deco_s3_p1_04",
            "rzb_dcocrfnt:deco_s3_p1_04": "rzb_dcocrfnt:deco_s3_p1_03",

            "rzb_dcocrfnt:deco_s3_p1_05": "rzb_dcocrfnt:deco_s3_p1_06",
            "rzb_dcocrfnt:deco_s3_p1_06": "rzb_dcocrfnt:deco_s3_p1_05",

            "rzb_dcocrfnt:deco_s3_p1_09": "rzb_dcocrfnt:deco_s3_p1_10",
            "rzb_dcocrfnt:deco_s3_p1_10": "rzb_dcocrfnt:deco_s3_p1_09",

            "rzb_dcocrfnt:deco_s3_p1_11": "rzb_dcocrfnt:deco_s3_p1_12",
            "rzb_dcocrfnt:deco_s3_p1_12": "rzb_dcocrfnt:deco_s3_p1_11",

            "rzb_dcocrfnt:deco_s3_p1_13": "rzb_dcocrfnt:deco_s3_p1_14",
            "rzb_dcocrfnt:deco_s3_p1_14": "rzb_dcocrfnt:deco_s3_p1_13",

            "rzb_dcocrfnt:deco_s4_p1_13": "rzb_dcocrfnt:deco_s4_p1_20",
            "rzb_dcocrfnt:deco_s4_p1_20": "rzb_dcocrfnt:deco_s4_p1_13",

            "rzb_dcocrfnt:deco_s4_p1_14": "rzb_dcocrfnt:deco_s4_p1_21",
            "rzb_dcocrfnt:deco_s4_p1_21": "rzb_dcocrfnt:deco_s4_p1_14",

            "rzb_dcocrfnt:deco_s4_p1_15": "rzb_dcocrfnt:deco_s4_p1_22",
            "rzb_dcocrfnt:deco_s4_p1_22": "rzb_dcocrfnt:deco_s4_p1_15",

            "rzb_dcocrfnt:deco_s4_p1_16": "rzb_dcocrfnt:deco_s4_p1_23",
            "rzb_dcocrfnt:deco_s4_p1_23": "rzb_dcocrfnt:deco_s4_p1_16",

            "rzb_dcocrfnt:deco_s4_p1_17": "rzb_dcocrfnt:deco_s4_p1_24",
            "rzb_dcocrfnt:deco_s4_p1_24": "rzb_dcocrfnt:deco_s4_p1_17",

            "rzb_dcocrfnt:deco_s4_p1_18": "rzb_dcocrfnt:deco_s4_p1_25",
            "rzb_dcocrfnt:deco_s4_p1_25": "rzb_dcocrfnt:deco_s4_p1_18",

            "rzb_dcocrfnt:deco_s4_p1_19": "rzb_dcocrfnt:deco_s4_p1_26",
            "rzb_dcocrfnt:deco_s4_p1_26": "rzb_dcocrfnt:deco_s4_p1_19",

            "rzb_dcocrfnt:deco_s4_p2_03": "rzb_dcocrfnt:deco_s4_p2_08",
            "rzb_dcocrfnt:deco_s4_p2_08": "rzb_dcocrfnt:deco_s4_p2_03",

            "rzb_dcocrfnt:deco_s4_p2_04": "rzb_dcocrfnt:deco_s4_p2_09",
            "rzb_dcocrfnt:deco_s4_p2_09": "rzb_dcocrfnt:deco_s4_p2_04",

            "rzb_dcocrfnt:deco_s4_p2_05": "rzb_dcocrfnt:deco_s4_p2_10",
            "rzb_dcocrfnt:deco_s4_p2_10": "rzb_dcocrfnt:deco_s4_p2_05",

            "rzb_dcocrfnt:deco_s4_p2_06": "rzb_dcocrfnt:deco_s4_p2_11",
            "rzb_dcocrfnt:deco_s4_p2_11": "rzb_dcocrfnt:deco_s4_p2_06",

            "rzb_dcocrfnt:deco_s4_p2_07": "rzb_dcocrfnt:deco_s4_p2_12",
            "rzb_dcocrfnt:deco_s4_p2_12": "rzb_dcocrfnt:deco_s4_p2_07",

            "rzb_dcocrfnt:deco_s4_p2_13": "rzb_dcocrfnt:deco_s4_p2_17",
            "rzb_dcocrfnt:deco_s4_p2_17": "rzb_dcocrfnt:deco_s4_p2_13",

            "rzb_dcocrfnt:deco_s4_p2_14": "rzb_dcocrfnt:deco_s4_p2_18",
            "rzb_dcocrfnt:deco_s4_p2_18": "rzb_dcocrfnt:deco_s4_p2_14",

            "rzb_dcocrfnt:deco_s4_p2_15": "rzb_dcocrfnt:deco_s4_p2_19",
            "rzb_dcocrfnt:deco_s4_p2_19": "rzb_dcocrfnt:deco_s4_p2_15",

            "rzb_dcocrfnt:deco_s4_p2_16": "rzb_dcocrfnt:deco_s4_p2_20",
            "rzb_dcocrfnt:deco_s4_p2_20": "rzb_dcocrfnt:deco_s4_p2_16",

            "rzb_dcocrfnt:deco_s5_p1_09": "rzb_dcocrfnt:deco_s5_p1_10",
            "rzb_dcocrfnt:deco_s5_p1_10": "rzb_dcocrfnt:deco_s5_p1_11",
            "rzb_dcocrfnt:deco_s5_p1_11": "rzb_dcocrfnt:deco_s5_p1_09",

            "rzb_dcocrfnt:deco_s6_p1_13": "rzb_dcocrfnt:deco_s6_p1_14",
            "rzb_dcocrfnt:deco_s6_p1_14": "rzb_dcocrfnt:deco_s6_p1_15",
            "rzb_dcocrfnt:deco_s6_p1_15": "rzb_dcocrfnt:deco_s6_p1_16",
            "rzb_dcocrfnt:deco_s6_p1_16": "rzb_dcocrfnt:deco_s6_p1_17",
            "rzb_dcocrfnt:deco_s6_p1_17": "rzb_dcocrfnt:deco_s6_p1_13",

            "rzb_dcocrfnt:deco_s7_p1_01": "rzb_dcocrfnt:deco_s7_p1_02",
            "rzb_dcocrfnt:deco_s7_p1_02": "rzb_dcocrfnt:deco_s7_p1_03",
            "rzb_dcocrfnt:deco_s7_p1_03": "rzb_dcocrfnt:deco_s7_p1_01",

            "rzb_dcocrfnt:deco_s8_p1_01": "rzb_dcocrfnt:deco_s8_p1_02",
            "rzb_dcocrfnt:deco_s8_p1_02": "rzb_dcocrfnt:deco_s8_p1_01",

            "rzb_dcocrfnt:deco_s8_p1_03": "rzb_dcocrfnt:deco_s8_p1_04",
            "rzb_dcocrfnt:deco_s8_p1_04": "rzb_dcocrfnt:deco_s8_p1_03",

            "rzb_dcocrfnt:deco_s8_p1_05": "rzb_dcocrfnt:deco_s8_p1_06",
            "rzb_dcocrfnt:deco_s8_p1_06": "rzb_dcocrfnt:deco_s8_p1_05",

            "rzb_dcocrfnt:deco_s8_p1_07": "rzb_dcocrfnt:deco_s8_p1_08",
            "rzb_dcocrfnt:deco_s8_p1_08": "rzb_dcocrfnt:deco_s8_p1_07",
            
            "rzb_dcocrfnt:deco_s8_p1_09": "rzb_dcocrfnt:deco_s8_p1_10",
            "rzb_dcocrfnt:deco_s8_p1_10": "rzb_dcocrfnt:deco_s8_p1_09",
            
            "rzb_dcocrfnt:deco_s9_p1_01": "rzb_dcocrfnt:deco_s9_p1_02",
            "rzb_dcocrfnt:deco_s9_p1_02": "rzb_dcocrfnt:deco_s9_p1_01",
            
            "rzb_dcocrfnt:deco_s9_p1_05": "rzb_dcocrfnt:deco_s9_p1_06",
            "rzb_dcocrfnt:deco_s9_p1_06": "rzb_dcocrfnt:deco_s9_p1_05",
            
            "rzb_dcocrfnt:deco_s9_p1_07": "rzb_dcocrfnt:deco_s9_p1_08",
            "rzb_dcocrfnt:deco_s9_p1_08": "rzb_dcocrfnt:deco_s9_p1_07",
            
            "rzb_dcocrfnt:deco_s9_p1_09": "rzb_dcocrfnt:deco_s9_p1_10",
            "rzb_dcocrfnt:deco_s9_p1_10": "rzb_dcocrfnt:deco_s9_p1_09"
        };

        const nextBlockType = blockTransitions[block.typeId];
        if (nextBlockType) {
            system.runTimeout(() => {
                if (!checkAndSetCooldown(player,4)) return;
                player.playAnimation('animation.rzb_dcocrfnt.player.interact');
                world.playSound("mob.sheep.shear", block.location, soundOptions1);
                world.playSound("block.beehive.shear", block.location, soundOptions2);
                block.setPermutation(BlockPermutation.resolve(nextBlockType, { "minecraft:cardinal_direction": blockOrientation }));
            }, 1);
        }
    }
})

// Clipping blocks LEFT, and Removing parts blocks

world.beforeEvents.playerBreakBlock.subscribe((eventData) => {
    const {player, itemStack, block} = eventData;
    const blockOrientation = block.permutation.getState("minecraft:cardinal_direction");
    const blockState = block.permutation.getState("rzb_dcocrfnt:variation");

    // Clipping blocks LEFT

    // Vars blocks

    const blockVariationsMap = {
        2: [
            "rzb_dcocrfnt:deco_s11_p1_12_vars",
            "rzb_dcocrfnt:deco_s11_p1_16_vars",
            "rzb_dcocrfnt:deco_s11_p1_20_vars",
            "rzb_dcocrfnt:deco_s11_p1_24_vars",
            "rzb_dcocrfnt:deco_s2_p1_01_vars",
            "rzb_dcocrfnt:deco_s2_p1_03_vars",
            "rzb_dcocrfnt:deco_s2_p1_04_vars",
            "rzb_dcocrfnt:deco_s2_p1_06_vars",
            "rzb_dcocrfnt:deco_s2_p1_07_vars",
            "rzb_dcocrfnt:deco_s2_p1_09_vars",
            "rzb_dcocrfnt:deco_s2_p1_10_vars",
            "rzb_dcocrfnt:deco_s2_p1_12_vars",
            "rzb_dcocrfnt:deco_s2_p1_13_vars",
            "rzb_dcocrfnt:deco_s2_p1_15_vars"
        ],
        3: [
            "rzb_dcocrfnt:deco_s11_p1_14_vars",
            "rzb_dcocrfnt:deco_s11_p1_15_vars",
            "rzb_dcocrfnt:deco_s11_p1_18_vars",
            "rzb_dcocrfnt:deco_s11_p1_19_vars",
            "rzb_dcocrfnt:deco_s11_p1_22_vars",
            "rzb_dcocrfnt:deco_s11_p1_23_vars",
            "rzb_dcocrfnt:deco_s11_p1_26_vars",
            "rzb_dcocrfnt:deco_s11_p1_27_vars"
        ],
        4: [
            "rzb_dcocrfnt:deco_s11_p1_08_vars",
            "rzb_dcocrfnt:deco_s11_p1_09_vars",
            "rzb_dcocrfnt:deco_s11_p1_10_vars",
            "rzb_dcocrfnt:deco_s11_p1_11_vars",
            "rzb_dcocrfnt:deco_s11_p1_13_vars",
            "rzb_dcocrfnt:deco_s11_p1_17_vars",
            "rzb_dcocrfnt:deco_s11_p1_21_vars",
            "rzb_dcocrfnt:deco_s11_p1_25_vars",
            "rzb_dcocrfnt:deco_s5_p1_13_vars",
            "rzb_dcocrfnt:deco_s5_p1_14_vars",
            "rzb_dcocrfnt:deco_s5_p1_15_vars",
            "rzb_dcocrfnt:deco_s5_p1_16_vars",
            "rzb_dcocrfnt:deco_s5_p1_17_vars",
            "rzb_dcocrfnt:deco_s5_p1_18_vars",
            "rzb_dcocrfnt:deco_s5_p1_19_vars",
            "rzb_dcocrfnt:deco_s5_p1_20_vars",
            "rzb_dcocrfnt:deco_s5_p1_21_vars"
        ],
        5: [
            "rzb_dcocrfnt:deco_s2_p1_26_vars",
            "rzb_dcocrfnt:deco_s2_p2_02_vars",
            "rzb_dcocrfnt:deco_s2_p2_06_vars",
            "rzb_dcocrfnt:deco_s2_p2_10_vars",
            "rzb_dcocrfnt:deco_s2_p2_14_vars"
        ],
        6: [
            "rzb_dcocrfnt:deco_s2_p1_02_vars",
            "rzb_dcocrfnt:deco_s2_p1_05_vars",
            "rzb_dcocrfnt:deco_s2_p1_08_vars",
            "rzb_dcocrfnt:deco_s2_p1_11_vars",
            "rzb_dcocrfnt:deco_s2_p1_14_vars"
        ],
        7: [
            "rzb_dcocrfnt:deco_s5_p1_01_vars",
            "rzb_dcocrfnt:deco_s5_p1_02_vars",
            "rzb_dcocrfnt:deco_s5_p1_03_vars",
            "rzb_dcocrfnt:deco_s5_p1_04_vars",
            "rzb_dcocrfnt:deco_s5_p1_05_vars"
        ]
    };
    if (Object.values(blockVariationsMap).flat().includes(block.typeId) && itemStack?.typeId == "rzb_dcocrfnt:hedge_clipper") {
        eventData.cancel = true;
        for (const [variation, typeIds] of Object.entries(blockVariationsMap)) {
            if (typeIds.includes(block.typeId)) {
                system.runTimeout(() => {
                    if (!checkAndSetCooldown(player,4)) return;
                    player.playAnimation('animation.rzb_dcocrfnt.player.interact');
                    world.playSound("mob.sheep.shear", block.location, soundOptions1);
                    world.playSound("block.beehive.shear", block.location, soundOptions2);
                    const nextState = blockState === 0 ? parseInt(variation) : blockState - 1;
                    block.setPermutation(block.permutation.withState("rzb_dcocrfnt:variation", nextState));
                }, 1);
                break;
            }
        }
    }

    // Indvar blocks

    const blockPermutations = {
        "rzb_dcocrfnt:deco_s1_p1_01": "rzb_dcocrfnt:deco_s1_p1_04",
        "rzb_dcocrfnt:deco_s1_p1_02": "rzb_dcocrfnt:deco_s1_p1_01",
        "rzb_dcocrfnt:deco_s1_p1_03": "rzb_dcocrfnt:deco_s1_p1_02",
        "rzb_dcocrfnt:deco_s1_p1_04": "rzb_dcocrfnt:deco_s1_p1_03",

        "rzb_dcocrfnt:deco_s1_p1_05": "rzb_dcocrfnt:deco_s1_p1_07",
        "rzb_dcocrfnt:deco_s1_p1_06": "rzb_dcocrfnt:deco_s1_p1_05",
        "rzb_dcocrfnt:deco_s1_p1_07": "rzb_dcocrfnt:deco_s1_p1_06",

        "rzb_dcocrfnt:deco_s1_p1_10": "rzb_dcocrfnt:deco_s1_p1_12",
        "rzb_dcocrfnt:deco_s1_p1_11": "rzb_dcocrfnt:deco_s1_p1_10",
        "rzb_dcocrfnt:deco_s1_p1_12": "rzb_dcocrfnt:deco_s1_p1_11",

        "rzb_dcocrfnt:deco_s1_p1_13": "rzb_dcocrfnt:deco_s1_p1_15",
        "rzb_dcocrfnt:deco_s1_p1_14": "rzb_dcocrfnt:deco_s1_p1_13",
        "rzb_dcocrfnt:deco_s1_p1_15": "rzb_dcocrfnt:deco_s1_p1_14",

        "rzb_dcocrfnt:deco_s1_p1_16": "rzb_dcocrfnt:deco_s1_p1_17",
        "rzb_dcocrfnt:deco_s1_p1_17": "rzb_dcocrfnt:deco_s1_p1_16",

        "rzb_dcocrfnt:deco_s1_p1_18": "rzb_dcocrfnt:deco_s1_p1_19",
        "rzb_dcocrfnt:deco_s1_p1_19": "rzb_dcocrfnt:deco_s1_p1_18",

        "rzb_dcocrfnt:deco_s1_p1_20": "rzb_dcocrfnt:deco_s1_p1_21",
        "rzb_dcocrfnt:deco_s1_p1_21": "rzb_dcocrfnt:deco_s1_p1_20",

        "rzb_dcocrfnt:deco_s2_p1_16": "rzb_dcocrfnt:deco_s2_p1_17",
        "rzb_dcocrfnt:deco_s2_p1_17": "rzb_dcocrfnt:deco_s2_p1_16",

        "rzb_dcocrfnt:deco_s2_p1_18": "rzb_dcocrfnt:deco_s2_p1_19",
        "rzb_dcocrfnt:deco_s2_p1_19": "rzb_dcocrfnt:deco_s2_p1_18",

        "rzb_dcocrfnt:deco_s2_p1_20": "rzb_dcocrfnt:deco_s2_p1_21",
        "rzb_dcocrfnt:deco_s2_p1_21": "rzb_dcocrfnt:deco_s2_p1_20",

        "rzb_dcocrfnt:deco_s2_p1_22": "rzb_dcocrfnt:deco_s2_p1_23",
        "rzb_dcocrfnt:deco_s2_p1_23": "rzb_dcocrfnt:deco_s2_p1_22",

        "rzb_dcocrfnt:deco_s2_p1_24": "rzb_dcocrfnt:deco_s2_p1_25",
        "rzb_dcocrfnt:deco_s2_p1_25": "rzb_dcocrfnt:deco_s2_p1_24",

        "rzb_dcocrfnt:deco_s3_p1_01": "rzb_dcocrfnt:deco_s3_p1_02",
        "rzb_dcocrfnt:deco_s3_p1_02": "rzb_dcocrfnt:deco_s3_p1_01",

        "rzb_dcocrfnt:deco_s3_p1_03": "rzb_dcocrfnt:deco_s3_p1_04",
        "rzb_dcocrfnt:deco_s3_p1_04": "rzb_dcocrfnt:deco_s3_p1_03",

        "rzb_dcocrfnt:deco_s3_p1_05": "rzb_dcocrfnt:deco_s3_p1_06",
        "rzb_dcocrfnt:deco_s3_p1_06": "rzb_dcocrfnt:deco_s3_p1_05",

        "rzb_dcocrfnt:deco_s3_p1_09": "rzb_dcocrfnt:deco_s3_p1_10",
        "rzb_dcocrfnt:deco_s3_p1_10": "rzb_dcocrfnt:deco_s3_p1_09",

        "rzb_dcocrfnt:deco_s3_p1_11": "rzb_dcocrfnt:deco_s3_p1_12",
        "rzb_dcocrfnt:deco_s3_p1_12": "rzb_dcocrfnt:deco_s3_p1_11",

        "rzb_dcocrfnt:deco_s3_p1_13": "rzb_dcocrfnt:deco_s3_p1_14",
        "rzb_dcocrfnt:deco_s3_p1_14": "rzb_dcocrfnt:deco_s3_p1_13",

        "rzb_dcocrfnt:deco_s4_p1_13": "rzb_dcocrfnt:deco_s4_p1_20",
        "rzb_dcocrfnt:deco_s4_p1_20": "rzb_dcocrfnt:deco_s4_p1_13",

        "rzb_dcocrfnt:deco_s4_p1_14": "rzb_dcocrfnt:deco_s4_p1_21",
        "rzb_dcocrfnt:deco_s4_p1_21": "rzb_dcocrfnt:deco_s4_p1_14",

        "rzb_dcocrfnt:deco_s4_p1_15": "rzb_dcocrfnt:deco_s4_p1_22",
        "rzb_dcocrfnt:deco_s4_p1_22": "rzb_dcocrfnt:deco_s4_p1_15",

        "rzb_dcocrfnt:deco_s4_p1_16": "rzb_dcocrfnt:deco_s4_p1_23",
        "rzb_dcocrfnt:deco_s4_p1_23": "rzb_dcocrfnt:deco_s4_p1_16",

        "rzb_dcocrfnt:deco_s4_p1_17": "rzb_dcocrfnt:deco_s4_p1_24",
        "rzb_dcocrfnt:deco_s4_p1_24": "rzb_dcocrfnt:deco_s4_p1_17",
        
        "rzb_dcocrfnt:deco_s4_p1_18": "rzb_dcocrfnt:deco_s4_p1_25",
        "rzb_dcocrfnt:deco_s4_p1_25": "rzb_dcocrfnt:deco_s4_p1_18",

        "rzb_dcocrfnt:deco_s4_p1_19": "rzb_dcocrfnt:deco_s4_p1_26",
        "rzb_dcocrfnt:deco_s4_p1_26": "rzb_dcocrfnt:deco_s4_p1_19",

        "rzb_dcocrfnt:deco_s4_p2_03": "rzb_dcocrfnt:deco_s4_p2_08",
        "rzb_dcocrfnt:deco_s4_p2_08": "rzb_dcocrfnt:deco_s4_p2_03",

        "rzb_dcocrfnt:deco_s4_p2_04": "rzb_dcocrfnt:deco_s4_p2_09",
        "rzb_dcocrfnt:deco_s4_p2_09": "rzb_dcocrfnt:deco_s4_p2_04",

        "rzb_dcocrfnt:deco_s4_p2_05": "rzb_dcocrfnt:deco_s4_p2_10",
        "rzb_dcocrfnt:deco_s4_p2_10": "rzb_dcocrfnt:deco_s4_p2_05",

        "rzb_dcocrfnt:deco_s4_p2_06": "rzb_dcocrfnt:deco_s4_p2_11",
        "rzb_dcocrfnt:deco_s4_p2_11": "rzb_dcocrfnt:deco_s4_p2_06",

        "rzb_dcocrfnt:deco_s4_p2_07": "rzb_dcocrfnt:deco_s4_p2_12",
        "rzb_dcocrfnt:deco_s4_p2_12": "rzb_dcocrfnt:deco_s4_p2_07",

        "rzb_dcocrfnt:deco_s4_p2_13": "rzb_dcocrfnt:deco_s4_p2_17",
        "rzb_dcocrfnt:deco_s4_p2_17": "rzb_dcocrfnt:deco_s4_p2_13",

        "rzb_dcocrfnt:deco_s4_p2_14": "rzb_dcocrfnt:deco_s4_p2_18",
        "rzb_dcocrfnt:deco_s4_p2_18": "rzb_dcocrfnt:deco_s4_p2_14",

        "rzb_dcocrfnt:deco_s4_p2_15": "rzb_dcocrfnt:deco_s4_p2_19",
        "rzb_dcocrfnt:deco_s4_p2_19": "rzb_dcocrfnt:deco_s4_p2_15",

        "rzb_dcocrfnt:deco_s4_p2_16": "rzb_dcocrfnt:deco_s4_p2_20",
        "rzb_dcocrfnt:deco_s4_p2_20": "rzb_dcocrfnt:deco_s4_p2_16",

        "rzb_dcocrfnt:deco_s5_p1_09": "rzb_dcocrfnt:deco_s5_p1_11",
        "rzb_dcocrfnt:deco_s5_p1_10": "rzb_dcocrfnt:deco_s5_p1_09",
        "rzb_dcocrfnt:deco_s5_p1_11": "rzb_dcocrfnt:deco_s5_p1_10",

        "rzb_dcocrfnt:deco_s6_p1_13": "rzb_dcocrfnt:deco_s6_p1_17",
        "rzb_dcocrfnt:deco_s6_p1_14": "rzb_dcocrfnt:deco_s6_p1_13",
        "rzb_dcocrfnt:deco_s6_p1_15": "rzb_dcocrfnt:deco_s6_p1_14",
        "rzb_dcocrfnt:deco_s6_p1_16": "rzb_dcocrfnt:deco_s6_p1_15",
        "rzb_dcocrfnt:deco_s6_p1_17": "rzb_dcocrfnt:deco_s6_p1_16",

        "rzb_dcocrfnt:deco_s7_p1_01": "rzb_dcocrfnt:deco_s7_p1_03",
        "rzb_dcocrfnt:deco_s7_p1_02": "rzb_dcocrfnt:deco_s7_p1_01",
        "rzb_dcocrfnt:deco_s7_p1_03": "rzb_dcocrfnt:deco_s7_p1_02",

        "rzb_dcocrfnt:deco_s8_p1_01": "rzb_dcocrfnt:deco_s8_p1_02",
        "rzb_dcocrfnt:deco_s8_p1_02": "rzb_dcocrfnt:deco_s8_p1_01",

        "rzb_dcocrfnt:deco_s8_p1_03": "rzb_dcocrfnt:deco_s8_p1_04",
        "rzb_dcocrfnt:deco_s8_p1_04": "rzb_dcocrfnt:deco_s8_p1_03",

        "rzb_dcocrfnt:deco_s8_p1_05": "rzb_dcocrfnt:deco_s8_p1_06",
        "rzb_dcocrfnt:deco_s8_p1_06": "rzb_dcocrfnt:deco_s8_p1_05",

        "rzb_dcocrfnt:deco_s8_p1_07": "rzb_dcocrfnt:deco_s8_p1_08",
        "rzb_dcocrfnt:deco_s8_p1_08": "rzb_dcocrfnt:deco_s8_p1_07",
        
        "rzb_dcocrfnt:deco_s8_p1_09": "rzb_dcocrfnt:deco_s8_p1_10",
        "rzb_dcocrfnt:deco_s8_p1_10": "rzb_dcocrfnt:deco_s8_p1_09",
            
        "rzb_dcocrfnt:deco_s9_p1_01": "rzb_dcocrfnt:deco_s9_p1_02",
        "rzb_dcocrfnt:deco_s9_p1_02": "rzb_dcocrfnt:deco_s9_p1_01",
        
        "rzb_dcocrfnt:deco_s9_p1_05": "rzb_dcocrfnt:deco_s9_p1_06",
        "rzb_dcocrfnt:deco_s9_p1_06": "rzb_dcocrfnt:deco_s9_p1_05",
        
        "rzb_dcocrfnt:deco_s9_p1_07": "rzb_dcocrfnt:deco_s9_p1_08",
        "rzb_dcocrfnt:deco_s9_p1_08": "rzb_dcocrfnt:deco_s9_p1_07",
        
        "rzb_dcocrfnt:deco_s9_p1_09": "rzb_dcocrfnt:deco_s9_p1_10",
        "rzb_dcocrfnt:deco_s9_p1_10": "rzb_dcocrfnt:deco_s9_p1_09"
    };
    if (blockPermutations[block.typeId] && itemStack?.typeId == "rzb_dcocrfnt:hedge_clipper") {
        eventData.cancel = true;
        const nextBlockTypeTwo = blockPermutations[block.typeId];
        if (nextBlockTypeTwo) {
            system.runTimeout(() => {
                if (!checkAndSetCooldown(player,4)) return;
                player.playAnimation('animation.rzb_dcocrfnt.player.interact');
                world.playSound("mob.sheep.shear", block.location, soundOptions1);
                world.playSound("block.beehive.shear", block.location, soundOptions2);
                block.setPermutation(BlockPermutation.resolve(nextBlockTypeTwo, { "minecraft:cardinal_direction": blockOrientation }));
            }, 1);
        }
    }

    // Removing parts blocks

    const location = block.dimension.getBlock({ x: block.location.x, y: block.location.y + 1, z: block.location.z });
    
    const breakBlockParticle0_1 = [
        "rzb_dcocrfnt:deco_s2_p1_28_parts",
        "rzb_dcocrfnt:deco_s2_p2_01_parts"
    ];
    const breakBlockParticle0_2 = [
        "rzb_dcocrfnt:deco_s2_p2_04_parts",
        "rzb_dcocrfnt:deco_s2_p2_05_parts"
    ];
    const breakBlockParticle0_3 = [
        "rzb_dcocrfnt:deco_s2_p2_08_parts",
        "rzb_dcocrfnt:deco_s2_p2_09_parts"
    ];
    const breakBlockParticle0_4 = [
        "rzb_dcocrfnt:deco_s2_p2_12_parts",
        "rzb_dcocrfnt:deco_s2_p2_13_parts"
    ];
    const breakBlockParticle0_5 = [
        "rzb_dcocrfnt:deco_s2_p2_16_parts",
        "rzb_dcocrfnt:deco_s2_p2_17_parts"
    ];
    const arrayOfStringsOne = [
        "rzb_dcocrfnt:deco_s2_p1_28_parts",
        "rzb_dcocrfnt:deco_s2_p2_01_parts",
        "rzb_dcocrfnt:deco_s2_p2_04_parts",
        "rzb_dcocrfnt:deco_s2_p2_05_parts",
        "rzb_dcocrfnt:deco_s2_p2_08_parts",
        "rzb_dcocrfnt:deco_s2_p2_09_parts",
        "rzb_dcocrfnt:deco_s2_p2_12_parts",
        "rzb_dcocrfnt:deco_s2_p2_13_parts",
        "rzb_dcocrfnt:deco_s2_p2_16_parts",
        "rzb_dcocrfnt:deco_s2_p2_17_parts",
        "rzb_dcocrfnt:deco_s11_p1_06",
        "rzb_dcocrfnt:deco_s11_p1_07"
    ];
    if (breakBlockParticle0_1.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_28-01 ${block.location.x} ${block.location.y + 0.6} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle0_2.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p2_04-05 ${block.location.x} ${block.location.y + 0.6} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle0_3.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p2_08-09 ${block.location.x} ${block.location.y + 0.6} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle0_4.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p2_12-13 ${block.location.x} ${block.location.y + 0.6} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle0_5.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p2_16-17 ${block.location.x} ${block.location.y + 0.6} ${block.location.z}`);
        }, 1);
    }

    const resultOne = arrayOfStringsOne.some((str) => block.permutation.matches(str));
    if (resultOne) {
        system.runTimeout(() => {
            location.setPermutation(BlockPermutation.resolve('minecraft:air'));
        }, 0);
    }

    const blockCardinalDir = block.permutation.getState("minecraft:cardinal_direction");

    const directions = {
        south: [
            { x: 0, y: 0, z: 1 },
            { x: 0, y: 0, z: -1 },
            { x: -1, y: 0, z: -1 },
            { x: -1, y: 0, z: 0 },
            { x: 0, y: 1, z: -1 }
        ],
        west: [
            { x: -1, y: 0, z: 0 },
            { x: 1, y: 0, z: 0 },
            { x: 1, y: 0, z: -1 },
            { x: 0, y: 0, z: -1 },
            { x: 1, y: 1, z: 0 }
        ],
        north: [
            { x: 0, y: 0, z: -1 },
            { x: 0, y: 0, z: 1 },
            { x: 1, y: 0, z: 1 },
            { x: 1, y: 0, z: 0 },
            { x: 0, y: 1, z: 1 }
        ],
        east: [
            { x: 1, y: 0, z: 0 },
            { x: -1, y: 0, z: 0 },
            { x: -1, y: 0, z: 1 },
            { x: 0, y: 0, z: 1 },
            { x: -1, y: 1, z: 0 }
        ]
    };

    const removeBlocks = (offsets, delay = 1) => {
        system.runTimeout(() => {
            offsets.forEach(offset => {
                const loc = block.dimension.getBlock({
                    x: block.location.x + offset.x,
                    y: block.location.y + offset.y,
                    z: block.location.z + offset.z
                });
                loc.setPermutation(BlockPermutation.resolve('minecraft:air'));
            });
        }, delay);
    };

    const arrayOfStringsTwo = [
        "rzb_dcocrfnt:deco_s10_p1_18_part1",
        "rzb_dcocrfnt:deco_s10_p1_19_part1",
        "rzb_dcocrfnt:deco_s10_p1_20_part1",
        "rzb_dcocrfnt:deco_s10_p1_21_part1"
    ];
    const resultTwo = arrayOfStringsTwo.some(str => block.permutation.matches(str));
    if (resultTwo) {
        removeBlocks([directions[blockCardinalDir][0]]);
    }

    const resultThree = block.permutation.matches("rzb_dcocrfnt:deco_s3_p1_15_parts");
    if (resultThree) {
        removeBlocks(directions[blockCardinalDir]);
    }

    const resultFour = block.permutation.matches("rzb_dcocrfnt:deco_s3_p1_16_parts");
    if (resultFour) {
        removeBlocks([{ x: 0, y: 1, z: 0 }, { x: 0, y: 2, z: 0 }], 0);
        removeBlocks(directions[blockCardinalDir]);
    }

    const arrayOfStringsFive = [
        "rzb_dcocrfnt:deco_s3_p1_17_parts",
        "rzb_dcocrfnt:deco_s3_p1_18_parts",
        "rzb_dcocrfnt:deco_s3_p1_19_parts"
    ];
    if (arrayOfStringsFive.some(str => block.permutation.matches(str))) {
        removeBlocks([{ x: 0, y: 1, z: 0 }], 0);
        removeBlocks(directions[blockCardinalDir]);
    }

    // Emit break block particle when removing simple blocks
    
    const breakBlockParticle1 = [
        "rzb_dcocrfnt:deco_s1_p1_01",
        "rzb_dcocrfnt:deco_s1_p1_02",
        "rzb_dcocrfnt:deco_s1_p1_03",
        "rzb_dcocrfnt:deco_s1_p1_04"
    ];
    const breakBlockParticle2 = [
        "rzb_dcocrfnt:deco_s1_p1_05",
        "rzb_dcocrfnt:deco_s1_p1_06",
        "rzb_dcocrfnt:deco_s1_p1_07"
    ];
    const breakBlockParticle3 = [
        "rzb_dcocrfnt:deco_s1_p1_10",
        "rzb_dcocrfnt:deco_s1_p1_11",
        "rzb_dcocrfnt:deco_s1_p1_12"
    ];
    const breakBlockParticle4 = [
        "rzb_dcocrfnt:deco_s1_p1_13",
        "rzb_dcocrfnt:deco_s1_p1_14",
        "rzb_dcocrfnt:deco_s1_p1_15"
    ];
    const breakBlockParticle5 = [
        "rzb_dcocrfnt:deco_s1_p1_16",
        "rzb_dcocrfnt:deco_s1_p1_17"
    ];
    const breakBlockParticle6 = [
        "rzb_dcocrfnt:deco_s1_p1_18",
        "rzb_dcocrfnt:deco_s1_p1_19"
    ];
    const breakBlockParticle7 = [
        "rzb_dcocrfnt:deco_s1_p1_20",
        "rzb_dcocrfnt:deco_s1_p1_21"
    ];
    const breakBlockParticle8 = [
        "rzb_dcocrfnt:deco_s2_p1_01_vars",
        "rzb_dcocrfnt:deco_s2_p1_02_vars",
        "rzb_dcocrfnt:deco_s2_p1_03_vars"
    ];
    const breakBlockParticle9 = [
        "rzb_dcocrfnt:deco_s2_p1_04_vars",
        "rzb_dcocrfnt:deco_s2_p1_05_vars",
        "rzb_dcocrfnt:deco_s2_p1_06_vars"
    ];
    const breakBlockParticle10 = [
        "rzb_dcocrfnt:deco_s2_p1_07_vars",
        "rzb_dcocrfnt:deco_s2_p1_08_vars",
        "rzb_dcocrfnt:deco_s2_p1_09_vars"
    ];
    const breakBlockParticle11 = [
        "rzb_dcocrfnt:deco_s2_p1_10_vars",
        "rzb_dcocrfnt:deco_s2_p1_11_vars",
        "rzb_dcocrfnt:deco_s2_p1_12_vars"
    ];
    const breakBlockParticle12 = [
        "rzb_dcocrfnt:deco_s2_p1_13_vars",
        "rzb_dcocrfnt:deco_s2_p1_14_vars",
        "rzb_dcocrfnt:deco_s2_p1_15_vars"
    ];
    const breakBlockParticle13 = [
        "rzb_dcocrfnt:deco_s2_p1_16",
        "rzb_dcocrfnt:deco_s2_p1_17"
    ];
    const breakBlockParticle14 = [
        "rzb_dcocrfnt:deco_s2_p1_18",
        "rzb_dcocrfnt:deco_s2_p1_19"
    ];
    const breakBlockParticle15 = [
        "rzb_dcocrfnt:deco_s2_p1_20",
        "rzb_dcocrfnt:deco_s2_p1_21"
    ];
    const breakBlockParticle16 = [
        "rzb_dcocrfnt:deco_s2_p1_22",
        "rzb_dcocrfnt:deco_s2_p1_23"
    ];
    const breakBlockParticle17 = [
        "rzb_dcocrfnt:deco_s2_p1_24",
        "rzb_dcocrfnt:deco_s2_p1_25"
    ];
    const breakBlockParticle18 = [
        "rzb_dcocrfnt:deco_s2_p1_26_vars",
        "rzb_dcocrfnt:deco_s2_p1_27"
    ];
    const breakBlockParticle19 = [
        "rzb_dcocrfnt:deco_s2_p2_02_vars",
        "rzb_dcocrfnt:deco_s2_p2_03"
    ];
    const breakBlockParticle20 = [
        "rzb_dcocrfnt:deco_s2_p2_06_vars",
        "rzb_dcocrfnt:deco_s2_p2_07"
    ];
    const breakBlockParticle21 = [
        "rzb_dcocrfnt:deco_s2_p2_10_vars",
        "rzb_dcocrfnt:deco_s2_p2_11"
    ];
    const breakBlockParticle22 = [
        "rzb_dcocrfnt:deco_s2_p2_14_vars",
        "rzb_dcocrfnt:deco_s2_p2_15"
    ];
    const breakBlockParticle23 = [
        "rzb_dcocrfnt:deco_s3_p1_01",
        "rzb_dcocrfnt:deco_s3_p1_02"
    ];
    const breakBlockParticle24 = [
        "rzb_dcocrfnt:deco_s3_p1_03",
        "rzb_dcocrfnt:deco_s3_p1_04"
    ];
    const breakBlockParticle25 = [
        "rzb_dcocrfnt:deco_s3_p1_11",
        "rzb_dcocrfnt:deco_s3_p1_12"
    ];
    const breakBlockParticle26 = [
        "rzb_dcocrfnt:deco_s3_p1_13",
        "rzb_dcocrfnt:deco_s3_p1_14"
    ];
    const breakBlockParticle27 = [
        "rzb_dcocrfnt:deco_s3_p1_15_parts",
        "rzb_dcocrfnt:deco_s3_p1_16_parts"
    ];
    const breakBlockParticle28 = [
        "rzb_dcocrfnt:deco_s3_p1_17_parts",
        "rzb_dcocrfnt:deco_s3_p1_18_parts",
        "rzb_dcocrfnt:deco_s3_p1_19_parts"
    ];
    const breakBlockParticle29 = [
        "rzb_dcocrfnt:deco_s4_p1_01",
        "rzb_dcocrfnt:deco_s4_p1_02",
        "rzb_dcocrfnt:deco_s4_p1_03",
        "rzb_dcocrfnt:deco_s4_p1_04",
        "rzb_dcocrfnt:deco_s4_p1_05",
        "rzb_dcocrfnt:deco_s4_p1_06",
        "rzb_dcocrfnt:deco_s4_p1_07",
        "rzb_dcocrfnt:deco_s4_p1_08",
        "rzb_dcocrfnt:deco_s4_p1_09"
    ];
    const breakBlockParticle30 = [
        "rzb_dcocrfnt:deco_s4_p1_10",
        "rzb_dcocrfnt:deco_s4_p1_11",
        "rzb_dcocrfnt:deco_s4_p1_12"
    ];
    const breakBlockParticle31 = [
        "rzb_dcocrfnt:deco_s4_p1_13",
        "rzb_dcocrfnt:deco_s4_p1_14",
        "rzb_dcocrfnt:deco_s4_p1_15",
        "rzb_dcocrfnt:deco_s4_p1_16",
        "rzb_dcocrfnt:deco_s4_p1_17",
        "rzb_dcocrfnt:deco_s4_p1_18",
        "rzb_dcocrfnt:deco_s4_p1_19",
        "rzb_dcocrfnt:deco_s4_p1_20",
        "rzb_dcocrfnt:deco_s4_p1_21",
        "rzb_dcocrfnt:deco_s4_p1_22",
        "rzb_dcocrfnt:deco_s4_p1_23",
        "rzb_dcocrfnt:deco_s4_p1_24",
        "rzb_dcocrfnt:deco_s4_p1_25",
        "rzb_dcocrfnt:deco_s4_p1_26"
    ];
    const breakBlockParticle32 = [
        "rzb_dcocrfnt:deco_s4_p1_27",
        "rzb_dcocrfnt:deco_s4_p1_28",
        "rzb_dcocrfnt:deco_s4_p2_01",
        "rzb_dcocrfnt:deco_s4_p2_02"
    ];
    const breakBlockParticle33 = [
        "rzb_dcocrfnt:deco_s4_p2_03",
        "rzb_dcocrfnt:deco_s4_p2_04",
        "rzb_dcocrfnt:deco_s4_p2_05",
        "rzb_dcocrfnt:deco_s4_p2_06",
        "rzb_dcocrfnt:deco_s4_p2_07",
        "rzb_dcocrfnt:deco_s4_p2_08",
        "rzb_dcocrfnt:deco_s4_p2_09",
        "rzb_dcocrfnt:deco_s4_p2_10",
        "rzb_dcocrfnt:deco_s4_p2_11",
        "rzb_dcocrfnt:deco_s4_p2_12"
    ];
    const breakBlockParticle34 = [
        "rzb_dcocrfnt:deco_s4_p2_13",
        "rzb_dcocrfnt:deco_s4_p2_14",
        "rzb_dcocrfnt:deco_s4_p2_15",
        "rzb_dcocrfnt:deco_s4_p2_16",
        "rzb_dcocrfnt:deco_s4_p2_17",
        "rzb_dcocrfnt:deco_s4_p2_18",
        "rzb_dcocrfnt:deco_s4_p2_19",
        "rzb_dcocrfnt:deco_s4_p2_20"
    ];
    const breakBlockParticle35 = [
        "rzb_dcocrfnt:deco_s4_p2_21",
        "rzb_dcocrfnt:deco_s4_p2_22",
        "rzb_dcocrfnt:deco_s4_p2_23",
        "rzb_dcocrfnt:deco_s4_p2_24",
        "rzb_dcocrfnt:deco_s4_p2_25",
        "rzb_dcocrfnt:deco_s4_p2_26",
        "rzb_dcocrfnt:deco_s4_p2_27"
    ];
    const breakBlockParticle36 = [
        "rzb_dcocrfnt:deco_s5_p1_01_vars",
        "rzb_dcocrfnt:deco_s5_p1_02_vars",
        "rzb_dcocrfnt:deco_s5_p1_03_vars",
        "rzb_dcocrfnt:deco_s5_p1_04_vars",
        "rzb_dcocrfnt:deco_s5_p1_05_vars"
    ];
    const breakBlockParticle37 = [
        "rzb_dcocrfnt:deco_s5_p1_06",
        "rzb_dcocrfnt:deco_s5_p1_07",
        "rzb_dcocrfnt:deco_s5_p1_08"
    ];
    const breakBlockParticle38 = [
        "rzb_dcocrfnt:deco_s5_p1_09",
        "rzb_dcocrfnt:deco_s5_p1_10",
        "rzb_dcocrfnt:deco_s5_p1_11"
    ];
    const breakBlockParticle39 = [
        "rzb_dcocrfnt:deco_s5_p1_13_vars",
        "rzb_dcocrfnt:deco_s5_p1_14_vars",
        "rzb_dcocrfnt:deco_s5_p1_15_vars"
    ];
    const breakBlockParticle40 = [
        "rzb_dcocrfnt:deco_s5_p1_16_vars",
        "rzb_dcocrfnt:deco_s5_p1_17_vars",
        "rzb_dcocrfnt:deco_s5_p1_18_vars"
    ];
    const breakBlockParticle41 = [
        "rzb_dcocrfnt:deco_s5_p1_19_vars",
        "rzb_dcocrfnt:deco_s5_p1_20_vars",
        "rzb_dcocrfnt:deco_s5_p1_21_vars"
    ];
    const breakBlockParticle42 = [
        "rzb_dcocrfnt:deco_s7_p1_01",
        "rzb_dcocrfnt:deco_s7_p1_02",
        "rzb_dcocrfnt:deco_s7_p1_03"
    ];
    const breakBlockParticle43 = [
        "rzb_dcocrfnt:deco_s8_p1_01",
        "rzb_dcocrfnt:deco_s8_p1_02"
    ];
    const breakBlockParticle44 = [
        "rzb_dcocrfnt:deco_s8_p1_03",
        "rzb_dcocrfnt:deco_s8_p1_04"
    ];
    const breakBlockParticle45 = [
        "rzb_dcocrfnt:deco_s8_p1_05",
        "rzb_dcocrfnt:deco_s8_p1_06"
    ];
    const breakBlockParticle46 = [
        "rzb_dcocrfnt:deco_s8_p1_07",
        "rzb_dcocrfnt:deco_s8_p1_08"
    ];
    const breakBlockParticle47 = [
        "rzb_dcocrfnt:deco_s8_p1_09",
        "rzb_dcocrfnt:deco_s8_p1_10"
    ];
    const breakBlockParticle48 = [
        "rzb_dcocrfnt:deco_s9_p1_01",
        "rzb_dcocrfnt:deco_s9_p1_02"
    ];
    const breakBlockParticle49 = [
        "rzb_dcocrfnt:deco_s9_p1_05",
        "rzb_dcocrfnt:deco_s9_p1_06"
    ];
    const breakBlockParticle50 = [
        "rzb_dcocrfnt:deco_s9_p1_07",
        "rzb_dcocrfnt:deco_s9_p1_08",
        "rzb_dcocrfnt:deco_s9_p1_09",
        "rzb_dcocrfnt:deco_s9_p1_10"
    ];
    const breakBlockParticle51 = [
        "rzb_dcocrfnt:deco_s10_p1_01",
        "rzb_dcocrfnt:deco_s10_p1_02",
        "rzb_dcocrfnt:deco_s10_p1_03",
        "rzb_dcocrfnt:deco_s10_p1_04",
        "rzb_dcocrfnt:deco_s10_p1_05",
        "rzb_dcocrfnt:deco_s10_p1_06"
    ];
    const breakBlockParticle52 = [
        "rzb_dcocrfnt:deco_s10_p1_07",
        "rzb_dcocrfnt:deco_s10_p1_08",
        "rzb_dcocrfnt:deco_s10_p1_09",
        "rzb_dcocrfnt:deco_s10_p1_10"
    ];
    const breakBlockParticle53 = [
        "rzb_dcocrfnt:deco_s10_p1_18_part1",
        "rzb_dcocrfnt:deco_s10_p1_19_part1",
        "rzb_dcocrfnt:deco_s10_p1_20_part1",
        "rzb_dcocrfnt:deco_s10_p1_21_part1"
    ];
    const breakBlockParticle54 = [
        "rzb_dcocrfnt:deco_s10_p1_22",
        "rzb_dcocrfnt:deco_s10_p1_23"
    ];
    const breakBlockParticle55 = [
        "rzb_dcocrfnt:deco_s11_p1_06",
        "rzb_dcocrfnt:deco_s11_p1_07"
    ];
    const breakBlockParticle56 = [
        "rzb_dcocrfnt:deco_s11_p1_12_vars",
        "rzb_dcocrfnt:deco_s11_p1_13_vars",
        "rzb_dcocrfnt:deco_s11_p1_14_vars",
        "rzb_dcocrfnt:deco_s11_p1_15_vars"
    ];
    const breakBlockParticle57 = [
        "rzb_dcocrfnt:deco_s11_p1_16_vars",
        "rzb_dcocrfnt:deco_s11_p1_17_vars",
        "rzb_dcocrfnt:deco_s11_p1_18_vars",
        "rzb_dcocrfnt:deco_s11_p1_19_vars"
    ];
    const breakBlockParticle58 = [
        "rzb_dcocrfnt:deco_s11_p1_20_vars",
        "rzb_dcocrfnt:deco_s11_p1_21_vars",
        "rzb_dcocrfnt:deco_s11_p1_22_vars",
        "rzb_dcocrfnt:deco_s11_p1_23_vars"
    ];
    const breakBlockParticle59 = [
        "rzb_dcocrfnt:deco_s11_p1_24_vars",
        "rzb_dcocrfnt:deco_s11_p1_25_vars",
        "rzb_dcocrfnt:deco_s11_p1_26_vars",
        "rzb_dcocrfnt:deco_s11_p1_27_vars"
    ];

    if (breakBlockParticle1.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s1_p1_01-04 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle2.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s1_p1_05-07 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s1_p1_08") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s1_p1_08 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s1_p1_09") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s1_p1_09 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle3.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s1_p1_10-12 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle4.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s1_p1_13-15 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle5.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s1_p1_16-17 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle6.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s1_p1_18-19 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle7.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s1_p1_20-21 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (breakBlockParticle8.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_01-03 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle9.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_04-06 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle10.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_07-09 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle11.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_10-12 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle12.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_13-15 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle13.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_16-17 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle14.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_18-19 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle15.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_20-21 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle16.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_22-23 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle17.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_24-25 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle18.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p1_26-27 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle19.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p2_02-03 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle20.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p2_06-07 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle21.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p2_10-11 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle22.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s2_p2_14-15 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (breakBlockParticle23.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_01-02 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle24.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_03-04 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_05") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_05 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_06") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_06 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_07") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_07 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_08") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_08 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_09") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_09 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_10") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_10 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle25.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_11-12 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle26.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_13-14 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle27.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_15-16 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle28.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s3_p1_17-19 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (breakBlockParticle29.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s4_p1_01-09 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle30.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s4_p1_10-12 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle31.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s4_p1_13-26 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle32.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s4_p1_27-02 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle33.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s4_p2_03-12 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle34.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s4_p2_13-20 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle35.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s4_p2_21-27 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (breakBlockParticle36.some((str) => block.permutation.matches(str)) && blockState == 0) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_01-05_oak ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle36.some((str) => block.permutation.matches(str)) && blockState == 1) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_01-05_spruce ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle36.some((str) => block.permutation.matches(str)) && blockState == 2) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_01-05_birch ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle36.some((str) => block.permutation.matches(str)) && blockState == 3) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_01-05_jungle ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle36.some((str) => block.permutation.matches(str)) && blockState == 4) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_01-05_acacia ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle36.some((str) => block.permutation.matches(str)) && blockState == 5) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_01-05_darkoak ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle36.some((str) => block.permutation.matches(str)) && blockState == 6) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_01-05_mangrove ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle36.some((str) => block.permutation.matches(str)) && blockState == 7) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_01-05_cherry ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle37.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_06-08 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle38.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_09-11 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle39.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_13-15 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle40.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_16-18 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle41.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s5_p1_19-21 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_01") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_01 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_02") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_02 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_03") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_03 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_04") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_04 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_05") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_05 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_06") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_06 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_07") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_07 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_08") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_08 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_09") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_09 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_10") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_10 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_11") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_11 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_12") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_12 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_13") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_13 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_14") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_14 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_15") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_15 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_16") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_16 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s6_p1_17") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s6_p1_17 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (breakBlockParticle42.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s7_p1_01-03 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (breakBlockParticle43.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s8_p1_01-02 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle44.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s8_p1_03-04 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle45.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s8_p1_05-06 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle46.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s8_p1_07-08 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle47.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s8_p1_09-10 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (breakBlockParticle48.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s9_p1_01-02 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s9_p1_03") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s9_p1_03 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s9_p1_04") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s9_p1_04 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle49.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s9_p1_05-06 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle50.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s9_p1_07-10 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (breakBlockParticle51.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s10_p1_01-06 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle52.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s10_p1_07-10 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s10_p1_11") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s10_p1_11 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s10_p1_12") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s10_p1_12 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s10_p1_13") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s10_p1_13 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s10_p1_17") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s10_p1_17 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle53.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s10_p1_18-21 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle54.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s10_p1_22-23 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);

    } else if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_01") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_01 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_02") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_02 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_03") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_03 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_04") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_04 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle55.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_06-07 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_08_vars") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_08 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_09_vars") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_09 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_10_vars") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_10 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_11_vars") {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_11 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle56.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_12-15 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle57.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_16-19 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle58.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_20-23 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    } else if (breakBlockParticle59.some((str) => block.permutation.matches(str))) {
        system.runTimeout(() => {
            block.dimension.runCommand(`particle rzb_dcocrfnt:block_break_s11_p1_24-27 ${block.location.x} ${block.location.y - 0.1} ${block.location.z}`);
        }, 1);
    }
})

// Parts blocks PLACE (with custom components)

const directions = ["north", "east", "south", "west"];
const directionsTwo = ["south", "west", "north", "east"];

world.afterEvents.playerPlaceBlock.subscribe((eventData) => {
    const block = eventData.block;
    const location = block.dimension.getBlock({ x: block.location.x, y: block.location.y + 1, z: block.location.z });
    const player = eventData.player;

    const { y: yaw } = player.getRotation();
    const normalizedYaw = (yaw % 360 + 360) % 360;
    const index = Math.floor((normalizedYaw + 45) / 90) % 4;
    const playerDirection = directions[index];
    const playerDirectionTwo = directionsTwo[index];

    if (block.typeId == "rzb_dcocrfnt:deco_s2_p1_28_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p1_28_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p1_28_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }
    
    if (block.typeId == "rzb_dcocrfnt:deco_s2_p2_01_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p2_01_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p2_01_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }
    
    if (block.typeId == "rzb_dcocrfnt:deco_s2_p2_04_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p2_04_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p2_04_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s2_p2_05_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p2_05_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p2_05_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s2_p2_08_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p2_08_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p2_08_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s2_p2_09_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p2_09_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p2_09_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s2_p2_12_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p2_12_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p2_12_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s2_p2_13_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p2_13_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p2_13_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s2_p2_16_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p2_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p2_16_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s2_p2_17_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s2_p2_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s2_p2_17_parts', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_06_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:invisible_block_4', { "minecraft:cardinal_direction": playerDirectionTwo }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s11_p1_06', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s11_p1_07_parts") {
        if(location.typeId == "minecraft:air" || location.typeId == "minecraft:water" || location.typeId == "minecraft:flowing_water") {
                location.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:invisible_block_4', { "minecraft:cardinal_direction": playerDirectionTwo }));
        } else {
            block.setPermutation(BlockPermutation.resolve('minecraft:air'));
            const item = new ItemStack('rzb_dcocrfnt:deco_s11_p1_07', 1)
            player.dimension.spawnItem(item, player.location);
            player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
            player.playSound("note.didgeridoo", soundOptions3);
        }
    }

    const location_1 = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z + 1 });
    const location_2 = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y, z: block.location.z });
    const location_3 = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z - 1 });
    const location_4 = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y, z: block.location.z });


    const location_1_1 = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z - 1});
    const location_1_2 = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y, z: block.location.z - 1 });
    const location_1_3 = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y, z: block.location.z });

    const location_2_1 = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y, z: block.location.z});
    const location_2_2 = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y, z: block.location.z - 1 });
    const location_2_3 = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z - 1 });

    const location_3_1 = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z + 1});
    const location_3_2 = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y, z: block.location.z + 1 });
    const location_3_3 = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y, z: block.location.z });

    const location_4_1 = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y, z: block.location.z});
    const location_4_2 = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y, z: block.location.z + 1 });
    const location_4_3 = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z + 1 });

    
    const location_1_1_b = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z - 1});
    const location_1_2_b = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y, z: block.location.z - 1 });
    const location_1_3_b = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y, z: block.location.z });
    const location_1_5_b = block.dimension.getBlock({ x: block.location.x, y: block.location.y + 1, z: block.location.z - 1 });

    const location_2_1_b = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y, z: block.location.z});
    const location_2_2_b = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y, z: block.location.z - 1 });
    const location_2_3_b = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z - 1 });
    const location_2_5_b = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y + 1, z: block.location.z });

    const location_3_1_b = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z + 1});
    const location_3_2_b = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y, z: block.location.z + 1 });
    const location_3_3_b = block.dimension.getBlock({ x: block.location.x + 1, y: block.location.y, z: block.location.z });
    const location_3_5_b = block.dimension.getBlock({ x: block.location.x, y: block.location.y + 1, z: block.location.z + 1 });

    const location_4_1_b = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y, z: block.location.z});
    const location_4_2_b = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y, z: block.location.z + 1 });
    const location_4_3_b = block.dimension.getBlock({ x: block.location.x, y: block.location.y, z: block.location.z + 1 });
    const location_4_5_b = block.dimension.getBlock({ x: block.location.x - 1, y: block.location.y + 1, z: block.location.z });
    
    const location_1234_4 = block.dimension.getBlock({ x: block.location.x, y: block.location.y + 1, z: block.location.z });
    const location_1234_5 = block.dimension.getBlock({ x: block.location.x, y: block.location.y + 2, z: block.location.z });


    
    if (block.typeId == "rzb_dcocrfnt:deco_s10_p1_18_part1") {
        if(playerDirection == "north") {
            if(location_1.typeId == "minecraft:air" || location_1.typeId == "minecraft:water" || location_1.typeId == "minecraft:flowing_water") {
                location_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_18_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "east")  {
            if(location_2.typeId == "minecraft:air" || location_2.typeId == "minecraft:water" || location_2.typeId == "minecraft:flowing_water") {
                location_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_18_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "south")  {
            if(location_3.typeId == "minecraft:air" || location_3.typeId == "minecraft:water" || location_3.typeId == "minecraft:flowing_water") {
                location_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_18_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "west")  {
            if(location_4.typeId == "minecraft:air" || location_4.typeId == "minecraft:water" || location_4.typeId == "minecraft:flowing_water") {
                location_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_18_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s10_p1_19_part1") {
        if(playerDirection == "north") {
            if(location_1.typeId == "minecraft:air" || location_1.typeId == "minecraft:water" || location_1.typeId == "minecraft:flowing_water") {
                location_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_19_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "east")  {
            if(location_2.typeId == "minecraft:air" || location_2.typeId == "minecraft:water" || location_2.typeId == "minecraft:flowing_water") {
                location_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_19_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "south")  {
            if(location_3.typeId == "minecraft:air" || location_3.typeId == "minecraft:water" || location_3.typeId == "minecraft:flowing_water") {
                location_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_19_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "west")  {
            if(location_4.typeId == "minecraft:air" || location_4.typeId == "minecraft:water" || location_4.typeId == "minecraft:flowing_water") {
                location_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_19_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s10_p1_20_part1") {
        if(playerDirection == "north") {
            if(location_1.typeId == "minecraft:air" || location_1.typeId == "minecraft:water" || location_1.typeId == "minecraft:flowing_water") {
                location_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_20_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "east")  {
            if(location_2.typeId == "minecraft:air" || location_2.typeId == "minecraft:water" || location_2.typeId == "minecraft:flowing_water") {
                location_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_20_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "south")  {
            if(location_3.typeId == "minecraft:air" || location_3.typeId == "minecraft:water" || location_3.typeId == "minecraft:flowing_water") {
                location_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_20_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "west")  {
            if(location_4.typeId == "minecraft:air" || location_4.typeId == "minecraft:water" || location_4.typeId == "minecraft:flowing_water") {
                location_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_20_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s10_p1_21_part1") {
        if(playerDirection == "north") {
            if(location_1.typeId == "minecraft:air" || location_1.typeId == "minecraft:water" || location_1.typeId == "minecraft:flowing_water") {
                location_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_21_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "east")  {
            if(location_2.typeId == "minecraft:air" || location_2.typeId == "minecraft:water" || location_2.typeId == "minecraft:flowing_water") {
                location_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_21_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "south")  {
            if(location_3.typeId == "minecraft:air" || location_3.typeId == "minecraft:water" || location_3.typeId == "minecraft:flowing_water") {
                location_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_21_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "west")  {
            if(location_4.typeId == "minecraft:air" || location_4.typeId == "minecraft:water" || location_4.typeId == "minecraft:flowing_water") {
                location_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s10_p1_18-19-20-21_part2', { "minecraft:cardinal_direction": playerDirectionTwo }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s10_p1_21_part1', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        }
    }





    if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_15_parts") {
        if(playerDirection == "north") {
            if((location_1_1.typeId == "minecraft:air" || location_1_1.typeId == "minecraft:water" || location_1_1.typeId == "minecraft:flowing_water") && (location_1_2.typeId == "minecraft:air" || location_1_2.typeId == "minecraft:water" || location_1_2.typeId == "minecraft:flowing_water") && (location_1_3.typeId == "minecraft:air" || location_1_3.typeId == "minecraft:water" || location_1_3.typeId == "minecraft:flowing_water")) {
                location_1_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_1_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_1_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_15_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "east")  {
            if((location_2_1.typeId == "minecraft:air" || location_2_1.typeId == "minecraft:water" || location_2_1.typeId == "minecraft:flowing_water") && (location_2_2.typeId == "minecraft:air" || location_2_2.typeId == "minecraft:water" || location_2_2.typeId == "minecraft:flowing_water") && (location_2_3.typeId == "minecraft:air" || location_2_3.typeId == "minecraft:water" || location_2_3.typeId == "minecraft:flowing_water")) {
                location_2_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_2_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_2_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_15_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "south")  {
            if((location_3_1.typeId == "minecraft:air" || location_3_1.typeId == "minecraft:water" || location_3_1.typeId == "minecraft:flowing_water") && (location_3_2.typeId == "minecraft:air" || location_3_2.typeId == "minecraft:water" || location_3_2.typeId == "minecraft:flowing_water") && (location_3_3.typeId == "minecraft:air" || location_3_3.typeId == "minecraft:water" || location_3_3.typeId == "minecraft:flowing_water")) {
                location_3_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_3_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_3_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_15_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "west")  {
            if((location_4_1.typeId == "minecraft:air" || location_4_1.typeId == "minecraft:water" || location_4_1.typeId == "minecraft:flowing_water") && (location_4_2.typeId == "minecraft:air" || location_4_2.typeId == "minecraft:water" || location_4_2.typeId == "minecraft:flowing_water") && (location_4_3.typeId == "minecraft:air" || location_4_3.typeId == "minecraft:water" || location_4_3.typeId == "minecraft:flowing_water")) {
                location_4_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_4_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_4_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_15_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_15_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_16_parts") {
        if(playerDirection == "north") {
            if((location_1_1.typeId == "minecraft:air" || location_1_1.typeId == "minecraft:water" || location_1_1.typeId == "minecraft:flowing_water") && (location_1_2.typeId == "minecraft:air" || location_1_2.typeId == "minecraft:water" || location_1_2.typeId == "minecraft:flowing_water") && (location_1_3.typeId == "minecraft:air" || location_1_3.typeId == "minecraft:water" || location_1_3.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_1234_5.typeId == "minecraft:air" || location_1234_5.typeId == "minecraft:water" || location_1234_5.typeId == "minecraft:flowing_water")) {
                location_1_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_1_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_1_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_1234_5.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_16_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "east")  {
            if((location_2_1.typeId == "minecraft:air" || location_2_1.typeId == "minecraft:water" || location_2_1.typeId == "minecraft:flowing_water") && (location_2_2.typeId == "minecraft:air" || location_2_2.typeId == "minecraft:water" || location_2_2.typeId == "minecraft:flowing_water") && (location_2_3.typeId == "minecraft:air" || location_2_3.typeId == "minecraft:water" || location_2_3.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_1234_5.typeId == "minecraft:air" || location_1234_5.typeId == "minecraft:water" || location_1234_5.typeId == "minecraft:flowing_water")) {
                location_2_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_2_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_2_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_1234_5.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_16_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "south")  {
            if((location_3_1.typeId == "minecraft:air" || location_3_1.typeId == "minecraft:water" || location_3_1.typeId == "minecraft:flowing_water") && (location_3_2.typeId == "minecraft:air" || location_3_2.typeId == "minecraft:water" || location_3_2.typeId == "minecraft:flowing_water") && (location_3_3.typeId == "minecraft:air" || location_3_3.typeId == "minecraft:water" || location_3_3.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_1234_5.typeId == "minecraft:air" || location_1234_5.typeId == "minecraft:water" || location_1234_5.typeId == "minecraft:flowing_water")) {
                location_3_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_3_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_3_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_1234_5.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_16_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "west")  {
            if((location_4_1.typeId == "minecraft:air" || location_4_1.typeId == "minecraft:water" || location_4_1.typeId == "minecraft:flowing_water") && (location_4_2.typeId == "minecraft:air" || location_4_2.typeId == "minecraft:water" || location_4_2.typeId == "minecraft:flowing_water") && (location_4_3.typeId == "minecraft:air" || location_4_3.typeId == "minecraft:water" || location_4_3.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_1234_5.typeId == "minecraft:air" || location_1234_5.typeId == "minecraft:water" || location_1234_5.typeId == "minecraft:flowing_water")) {
                location_4_1.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_4_2.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_4_3.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_1234_5.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_16_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_16_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        }
    }

    



    if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_17_parts") {
        if(playerDirection == "north") {
            if((location_1_1_b.typeId == "minecraft:air" || location_1_1_b.typeId == "minecraft:water" || location_1_1_b.typeId == "minecraft:flowing_water") && (location_1_2_b.typeId == "minecraft:air" || location_1_2_b.typeId == "minecraft:water" || location_1_2_b.typeId == "minecraft:flowing_water") && (location_1_3_b.typeId == "minecraft:air" || location_1_3_b.typeId == "minecraft:water" || location_1_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_1_5_b.typeId == "minecraft:air" || location_1_5_b.typeId == "minecraft:water" || location_1_5_b.typeId == "minecraft:flowing_water")) {
                location_1_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_1_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_1_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_1_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_17_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "east")  {
            if((location_2_1_b.typeId == "minecraft:air" || location_2_1_b.typeId == "minecraft:water" || location_2_1_b.typeId == "minecraft:flowing_water") && (location_2_2_b.typeId == "minecraft:air" || location_2_2_b.typeId == "minecraft:water" || location_2_2_b.typeId == "minecraft:flowing_water") && (location_2_3_b.typeId == "minecraft:air" || location_2_3_b.typeId == "minecraft:water" || location_2_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_2_5_b.typeId == "minecraft:air" || location_2_5_b.typeId == "minecraft:water" || location_2_5_b.typeId == "minecraft:flowing_water")) {
                location_2_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_2_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_2_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_2_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_17_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "south")  {
            if((location_3_1_b.typeId == "minecraft:air" || location_3_1_b.typeId == "minecraft:water" || location_3_1_b.typeId == "minecraft:flowing_water") && (location_3_2_b.typeId == "minecraft:air" || location_3_2_b.typeId == "minecraft:water" || location_3_2_b.typeId == "minecraft:flowing_water") && (location_3_3_b.typeId == "minecraft:air" || location_3_3_b.typeId == "minecraft:water" || location_3_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_3_5_b.typeId == "minecraft:air" || location_3_5_b.typeId == "minecraft:water" || location_3_5_b.typeId == "minecraft:flowing_water")) {
                location_3_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_3_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_3_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_3_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_17_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "west")  {
            if((location_4_1_b.typeId == "minecraft:air" || location_4_1_b.typeId == "minecraft:water" || location_4_1_b.typeId == "minecraft:flowing_water") && (location_4_2_b.typeId == "minecraft:air" || location_4_2_b.typeId == "minecraft:water" || location_4_2_b.typeId == "minecraft:flowing_water") && (location_4_3_b.typeId == "minecraft:air" || location_4_3_b.typeId == "minecraft:water" || location_4_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_4_5_b.typeId == "minecraft:air" || location_4_5_b.typeId == "minecraft:water" || location_4_5_b.typeId == "minecraft:flowing_water")) {
                location_4_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_4_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_4_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_4_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_17_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_17_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_18_parts") {
        if(playerDirection == "north") {
            if((location_1_1_b.typeId == "minecraft:air" || location_1_1_b.typeId == "minecraft:water" || location_1_1_b.typeId == "minecraft:flowing_water") && (location_1_2_b.typeId == "minecraft:air" || location_1_2_b.typeId == "minecraft:water" || location_1_2_b.typeId == "minecraft:flowing_water") && (location_1_3_b.typeId == "minecraft:air" || location_1_3_b.typeId == "minecraft:water" || location_1_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_1_5_b.typeId == "minecraft:air" || location_1_5_b.typeId == "minecraft:water" || location_1_5_b.typeId == "minecraft:flowing_water")) {
                location_1_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_1_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_1_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_1_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_18_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "east")  {
            if((location_2_1_b.typeId == "minecraft:air" || location_2_1_b.typeId == "minecraft:water" || location_2_1_b.typeId == "minecraft:flowing_water") && (location_2_2_b.typeId == "minecraft:air" || location_2_2_b.typeId == "minecraft:water" || location_2_2_b.typeId == "minecraft:flowing_water") && (location_2_3_b.typeId == "minecraft:air" || location_2_3_b.typeId == "minecraft:water" || location_2_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_2_5_b.typeId == "minecraft:air" || location_2_5_b.typeId == "minecraft:water" || location_2_5_b.typeId == "minecraft:flowing_water")) {
                location_2_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_2_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_2_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_2_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_18_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "south")  {
            if((location_3_1_b.typeId == "minecraft:air" || location_3_1_b.typeId == "minecraft:water" || location_3_1_b.typeId == "minecraft:flowing_water") && (location_3_2_b.typeId == "minecraft:air" || location_3_2_b.typeId == "minecraft:water" || location_3_2_b.typeId == "minecraft:flowing_water") && (location_3_3_b.typeId == "minecraft:air" || location_3_3_b.typeId == "minecraft:water" || location_3_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_3_5_b.typeId == "minecraft:air" || location_3_5_b.typeId == "minecraft:water" || location_3_5_b.typeId == "minecraft:flowing_water")) {
                location_3_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_3_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_3_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_3_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_18_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "west")  {
            if((location_4_1_b.typeId == "minecraft:air" || location_4_1_b.typeId == "minecraft:water" || location_4_1_b.typeId == "minecraft:flowing_water") && (location_4_2_b.typeId == "minecraft:air" || location_4_2_b.typeId == "minecraft:water" || location_4_2_b.typeId == "minecraft:flowing_water") && (location_4_3_b.typeId == "minecraft:air" || location_4_3_b.typeId == "minecraft:water" || location_4_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_4_5_b.typeId == "minecraft:air" || location_4_5_b.typeId == "minecraft:water" || location_4_5_b.typeId == "minecraft:flowing_water")) {
                location_4_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_4_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_4_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_4_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_18_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_18_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        }
    }

    if (block.typeId == "rzb_dcocrfnt:deco_s3_p1_19_parts") {
        if(playerDirection == "north") {
            if((location_1_1_b.typeId == "minecraft:air" || location_1_1_b.typeId == "minecraft:water" || location_1_1_b.typeId == "minecraft:flowing_water") && (location_1_2_b.typeId == "minecraft:air" || location_1_2_b.typeId == "minecraft:water" || location_1_2_b.typeId == "minecraft:flowing_water") && (location_1_3_b.typeId == "minecraft:air" || location_1_3_b.typeId == "minecraft:water" || location_1_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_1_5_b.typeId == "minecraft:air" || location_1_5_b.typeId == "minecraft:water" || location_1_5_b.typeId == "minecraft:flowing_water")) {
                location_1_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_1_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_1_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_1_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_19_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "east")  {
            if((location_2_1_b.typeId == "minecraft:air" || location_2_1_b.typeId == "minecraft:water" || location_2_1_b.typeId == "minecraft:flowing_water") && (location_2_2_b.typeId == "minecraft:air" || location_2_2_b.typeId == "minecraft:water" || location_2_2_b.typeId == "minecraft:flowing_water") && (location_2_3_b.typeId == "minecraft:air" || location_2_3_b.typeId == "minecraft:water" || location_2_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_2_5_b.typeId == "minecraft:air" || location_2_5_b.typeId == "minecraft:water" || location_2_5_b.typeId == "minecraft:flowing_water")) {
                location_2_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_2_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_2_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_2_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_19_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "south")  {
            if((location_3_1_b.typeId == "minecraft:air" || location_3_1_b.typeId == "minecraft:water" || location_3_1_b.typeId == "minecraft:flowing_water") && (location_3_2_b.typeId == "minecraft:air" || location_3_2_b.typeId == "minecraft:water" || location_3_2_b.typeId == "minecraft:flowing_water") && (location_3_3_b.typeId == "minecraft:air" || location_3_3_b.typeId == "minecraft:water" || location_3_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_3_5_b.typeId == "minecraft:air" || location_3_5_b.typeId == "minecraft:water" || location_3_5_b.typeId == "minecraft:flowing_water")) {
                location_3_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_3_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_3_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_3_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_19_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        } else if(playerDirection == "west")  {
            if((location_4_1_b.typeId == "minecraft:air" || location_4_1_b.typeId == "minecraft:water" || location_4_1_b.typeId == "minecraft:flowing_water") && (location_4_2_b.typeId == "minecraft:air" || location_4_2_b.typeId == "minecraft:water" || location_4_2_b.typeId == "minecraft:flowing_water") && (location_4_3_b.typeId == "minecraft:air" || location_4_3_b.typeId == "minecraft:water" || location_4_3_b.typeId == "minecraft:flowing_water") && (location_1234_4.typeId == "minecraft:air" || location_1234_4.typeId == "minecraft:water" || location_1234_4.typeId == "minecraft:flowing_water") && (location_4_5_b.typeId == "minecraft:air" || location_4_5_b.typeId == "minecraft:water" || location_4_5_b.typeId == "minecraft:flowing_water")) {
                location_4_1_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 1 }));
                location_4_2_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 2 }));
                location_4_3_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 3 }));
                location_1234_4.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 4 }));
                location_4_5_b.setPermutation(BlockPermutation.resolve('rzb_dcocrfnt:deco_s3_p1_19_parts', { "minecraft:cardinal_direction": playerDirectionTwo, "rzb_dcocrfnt:part": 5 }));
            } else {
                block.setPermutation(BlockPermutation.resolve('minecraft:air'));
                const item = new ItemStack('rzb_dcocrfnt:deco_s3_p1_19_parts', 1)
                player.dimension.spawnItem(item, player.location);
                player.sendMessage({ translate : "dialogue.decocraft_message.place_deco" });
                player.playSound("note.didgeridoo", soundOptions3);
            }
        }
    }
});