import * as mc from '@minecraft/server';
import * as utils from './utils/index';
export function initializeGuideBook() {
    utils.mclog("book");
    utils.getAllPlayersSafe().forEach(giveGuideBook);
    mc.world.afterEvents.playerSpawn.subscribe(event => {
        if (event.initialSpawn) {
            giveGuideBook(new utils.SafetyCheckedPlayer(event.player));
        }
    });
}
function giveGuideBook(player) {
    let hasBook = false;
    if (player.runCommand("testfor @s[hasitem={item=ldz_240409:guide_book}]").successCount > 0)
        hasBook = true;
    if (utils.readDynamicProperty(player, "has_book"))
        hasBook = true;
    if (!hasBook) {
        player.runCommand('structure load "ldz_240409/guide_book" ~ ~ ~');
        utils.writeDynamicProperty(player, "has_book", true);
    }
}
export function useGuideBook(player) {
    utils.mclog("Using Book");
    let savedPage = utils.readDynamicProperty(player, "ldz_240409:guide_book_page") || "main";
    switch (savedPage) {
        case "main":
            BOOK.main.showMenuToPlayer(player);
            utils.writeDynamicProperty(player, "ldz_240409:guide_book_page", "main");
            break;
        case "weapons_menu":
            BOOK.weapons_menu.showMenuToPlayer(player);
            break;
        case "overview":
            BOOK.overview.showMenuToPlayer(player);
            break;
        default:
            BOOK.main.showMenuToPlayer(player);
    }
}
const BOOK = {
    main: new utils.ButtonMenu({ translate: "book.ldz_240409.main.title" }, [
        {
            text: { translate: "book.ldz_240409.weapons_menu.button" },
            texture: "textures/ldz/240409/items/weapon_cow",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
                utils.writeDynamicProperty(player, "ldz_240409:guide_book_page", "weapons_menu");
            },
        },
        {
            text: { translate: "book.ldz_240409.mob_magnet.button" },
            texture: "textures/ldz/240409/items/mob_magnet",
            onClick(player) {
                BOOK.mob_magnet.showMenuToPlayer(player);
            },
        },
        {
            text: { translate: "book.ldz_240409.settings.button" },
            texture: "textures/ui/automation_glyph_color",
            onClick(player) {
                BOOK.settings.showMenuToPlayer(player);
            },
        },
        {
            text: { translate: "book.ldz_240409.overview.button" },
            texture: "textures/ldz/240409/ui/infobulb",
            onClick(player) {
                BOOK.overview.showMenuToPlayer(player);
                utils.writeDynamicProperty(player, "ldz_240409:guide_book_page", "overview");
            },
        },
    ]),
    weapons_menu: new utils.ButtonMenu({ translate: "book.ldz_240409.weapons_menu.title" }, [
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedArmadillo') ? { translate: "item.ldz_240409:weapon_armadillo.name" } : { translate: "item.ldz_240409:weapon_armadillo.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedArmadillo') ? "textures/ldz/240409/items/weapon_armadillo" : "textures/ldz/240409/items/weapon_armadillo_silhouette"; },
            onClick(player) {
                BOOK.armadillo.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBee') ? { translate: "item.ldz_240409:weapon_bee.name" } : { translate: "item.ldz_240409:weapon_bee.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBee') ? "textures/ldz/240409/items/weapon_bee" : "textures/ldz/240409/items/weapon_bee_silhouette"; },
            onClick(player) {
                BOOK.bee.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBlaze') ? { translate: "item.ldz_240409:weapon_blaze.name" } : { translate: "item.ldz_240409:weapon_blaze.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBlaze') ? "textures/ldz/240409/items/weapon_blaze" : "textures/ldz/240409/items/weapon_blaze_silhouette"; },
            onClick(player) {
                BOOK.blaze.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBogged') ? { translate: "item.ldz_240409:weapon_bogged.name" } : { translate: "item.ldz_240409:weapon_bogged.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBogged') ? "textures/ldz/240409/items/weapon_bogged" : "textures/ldz/240409/items/weapon_bogged_silhouette"; },
            onClick(player) {
                BOOK.bogged.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBreeze') ? { translate: "item.ldz_240409:weapon_breeze.name" } : { translate: "item.ldz_240409:weapon_breeze.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBreeze') ? "textures/ldz/240409/items/weapon_breeze" : "textures/ldz/240409/items/weapon_breeze_silhouette"; },
            onClick(player) {
                BOOK.breeze.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedCow') ? { translate: "item.ldz_240409:weapon_cow.name" } : { translate: "item.ldz_240409:weapon_cow.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedCow') ? "textures/ldz/240409/items/weapon_cow" : "textures/ldz/240409/items/weapon_cow_silhouette"; },
            onClick(player) {
                BOOK.cow.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedChicken') ? { translate: "item.ldz_240409:weapon_chicken.name" } : { translate: "item.ldz_240409:weapon_chicken.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedChicken') ? "textures/ldz/240409/items/weapon_chicken" : "textures/ldz/240409/items/weapon_chicken_silhouette"; },
            onClick(player) {
                BOOK.chicken.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedCreeper') ? { translate: "item.ldz_240409:weapon_creeper.name" } : { translate: "item.ldz_240409:weapon_creeper.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedCreeper') ? "textures/ldz/240409/items/weapon_creeper" : "textures/ldz/240409/items/weapon_creeper_silhouette"; },
            onClick(player) {
                BOOK.creeper.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedEnderDragon') ? { translate: "item.ldz_240409:weapon_ender_dragon.name" } : { translate: "item.ldz_240409:weapon_ender_dragon.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedEnderDragon') ? "textures/ldz/240409/items/weapon_ender_dragon" : "textures/ldz/240409/items/weapon_ender_dragon_silhouette"; },
            onClick(player) {
                BOOK.ender_dragon.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedEnderman') ? { translate: "item.ldz_240409:weapon_enderman.name" } : { translate: "item.ldz_240409:weapon_enderman.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedEnderman') ? "textures/ldz/240409/items/weapon_enderman" : "textures/ldz/240409/items/weapon_enderman_silhouette"; },
            onClick(player) {
                BOOK.enderman.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedEvoker') ? { translate: "item.ldz_240409:weapon_evoker.name" } : { translate: "item.ldz_240409:weapon_evoker.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedEvoker') ? "textures/ldz/240409/items/weapon_evoker" : "textures/ldz/240409/items/weapon_evoker_silhouette"; },
            onClick(player) {
                BOOK.evoker.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedFrog') ? { translate: "item.ldz_240409:weapon_frog.name" } : { translate: "item.ldz_240409:weapon_frog.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedFrog') ? "textures/ldz/240409/items/weapon_frog" : "textures/ldz/240409/items/weapon_frog_silhouette"; },
            onClick(player) {
                BOOK.frog.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedGhast') ? { translate: "item.ldz_240409:weapon_ghast.name" } : { translate: "item.ldz_240409:weapon_ghast.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedGhast') ? "textures/ldz/240409/items/weapon_ghast" : "textures/ldz/240409/items/weapon_ghast_silhouette"; },
            onClick(player) {
                BOOK.ghast.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedIronGolem') ? { translate: "item.ldz_240409:weapon_iron_golem.name" } : { translate: "item.ldz_240409:weapon_iron_golem.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedIronGolem') ? "textures/ldz/240409/items/weapon_iron_golem" : "textures/ldz/240409/items/weapon_iron_golem_silhouette"; },
            onClick(player) {
                BOOK.iron_golem.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedGuardian') ? { translate: "item.ldz_240409:weapon_guardian.name" } : { translate: "item.ldz_240409:weapon_guardian.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedGuardian') ? "textures/ldz/240409/items/weapon_guardian" : "textures/ldz/240409/items/weapon_guardian_silhouette"; },
            onClick(player) {
                BOOK.guardian.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedPig') ? { translate: "item.ldz_240409:weapon_pig.name" } : { translate: "item.ldz_240409:weapon_pig.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedPig') ? "textures/ldz/240409/items/weapon_pig" : "textures/ldz/240409/items/weapon_pig_silhouette"; },
            onClick(player) {
                BOOK.pig.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedPiglin') ? { translate: "item.ldz_240409:weapon_piglin.name" } : { translate: "item.ldz_240409:weapon_piglin.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedPiglin') ? "textures/ldz/240409/items/weapon_piglin" : "textures/ldz/240409/items/weapon_piglin_silhouette"; },
            onClick(player) {
                BOOK.piglin.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedPufferfish') ? { translate: "item.ldz_240409:weapon_pufferfish.name" } : { translate: "item.ldz_240409:weapon_pufferfish.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedPufferfish') ? "textures/ldz/240409/items/weapon_pufferfish" : "textures/ldz/240409/items/weapon_pufferfish_silhouette"; },
            onClick(player) {
                BOOK.pufferfish.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSheep') ? { translate: "item.ldz_240409:weapon_sheep.name" } : { translate: "item.ldz_240409:weapon_sheep.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSheep') ? "textures/ldz/240409/items/weapon_sheep" : "textures/ldz/240409/items/weapon_sheep_silhouette"; },
            onClick(player) {
                BOOK.sheep.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSkeleton') ? { translate: "item.ldz_240409:weapon_skeleton.name" } : { translate: "item.ldz_240409:weapon_skeleton.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSkeleton') ? "textures/ldz/240409/items/weapon_skeleton" : "textures/ldz/240409/items/weapon_skeleton_silhouette"; },
            onClick(player) {
                BOOK.skeleton.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSlime') ? { translate: "item.ldz_240409:weapon_slime.name" } : { translate: "item.ldz_240409:weapon_slime.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSlime') ? "textures/ldz/240409/items/weapon_slime" : "textures/ldz/240409/items/weapon_slime_silhouette"; },
            onClick(player) {
                BOOK.slime.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSpider') ? { translate: "item.ldz_240409:weapon_spider.name" } : { translate: "item.ldz_240409:weapon_spider.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSpider') ? "textures/ldz/240409/items/weapon_spider" : "textures/ldz/240409/items/weapon_spider_silhouette"; },
            onClick(player) {
                BOOK.spider.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedVillager') ? { translate: "item.ldz_240409:weapon_villager.name" } : { translate: "item.ldz_240409:weapon_villager.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedVillager') ? "textures/ldz/240409/items/weapon_villager" : "textures/ldz/240409/items/weapon_villager_silhouette"; },
            onClick(player) {
                BOOK.villager.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedWarden') ? { translate: "item.ldz_240409:weapon_warden.name" } : { translate: "item.ldz_240409:weapon_warden.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedWarden') ? "textures/ldz/240409/items/weapon_warden" : "textures/ldz/240409/items/weapon_warden_silhouette"; },
            onClick(player) {
                BOOK.warden.showMenuToPlayer(player);
            },
        },
        {
            text(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedZombie') ? { translate: "item.ldz_240409:weapon_zombie.name" } : { translate: "item.ldz_240409:weapon_zombie.name_hidden" }; },
            texture(player) { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedZombie') ? "textures/ldz/240409/items/weapon_zombie" : "textures/ldz/240409/items/weapon_zombie_silhouette"; },
            onClick(player) {
                BOOK.zombie.showMenuToPlayer(player);
            },
        },
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.main.showMenuToPlayer(player);
                utils.writeDynamicProperty(player, "ldz_240409:guide_book_page", "main");
            },
        }
    ]),
    overview: new utils.ButtonMenu({ translate: "ldz_240409:update.version.name" }, [
        {
            text: { translate: "book.ldz_240409.how_to_play.button" },
            texture: "textures/ldz/240409/ui/infobulb",
            onClick(player) {
                BOOK.how_to_play.showMenuToPlayer(player);
            },
        },
        {
            text: { translate: "book.ldz_240409.changelog.button" },
            texture: "textures/ldz/240409/ui/changelog",
            onClick(player) {
                BOOK.changelog.showMenuToPlayer(player);
            },
        },
        {
            text: { translate: "book.ldz_240409.credits.button" },
            texture: "textures/ui/icon_book_writable",
            onClick(player) {
                BOOK.credits.showMenuToPlayer(player);
            },
        },
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.main.showMenuToPlayer(player);
                utils.writeDynamicProperty(player, "ldz_240409:guide_book_page", "main");
            },
        }
    ]),
    how_to_play: new utils.ButtonMenu({ translate: "ldz_240409:update.version.name" }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.overview.showMenuToPlayer(player);
            },
        }
    ], { translate: "book.ldz_240409.how_to_play.body", with: ['\n'] }),
    mob_magnet: new utils.ButtonMenu({ translate: "book.ldz_240409.mob_magnet.title" }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.main.showMenuToPlayer(player);
            },
        }
    ], { translate: "book.ldz_240409.mob_magnet.body", with: ['\n'] }),
    changelog: new utils.ButtonMenu({ translate: "ldz_240409:update.version.name" }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.overview.showMenuToPlayer(player);
            },
        }
    ], { translate: "book.ldz_240409.changelog.body", with: ['\n'] }),
    credits: new utils.ButtonMenu({ translate: "ldz_240409:update.version.name" }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.main.showMenuToPlayer(player);
            },
        }
    ], { translate: "book.ldz_240409.credits.body", with: ['\n'] }),
    settings: new utils.ModalMenu({ translate: "book.ldz_240409.settings.title" }, [
        {
            type: "toggle",
            text: { translate: "book.ldz_240409.settings.pvp" },
            defaultValue(player) {
                return mc.world.gameRules.pvp;
            },
            onSubmit(player, toggleValue) {
                player.runCommand(`gamerule pvp ${String(toggleValue)}`);
            },
        },
        //], {translate: "book.ldz_240409.generic.confirm"}), // TODO: update server ui to allow for submit button lang entries
    ]),
    armadillo: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedArmadillo') ? { translate: "item.ldz_240409:weapon_armadillo.name" } : { translate: "item.ldz_240409:weapon_armadillo.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.armadillo.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.armadillo.recipe", with: ['\n'] }] }),
    bee: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBee') ? { translate: "item.ldz_240409:weapon_bee.name" } : { translate: "item.ldz_240409:weapon_bee.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.bee.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.bee.recipe", with: ['\n'] }] }),
    blaze: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBlaze') ? { translate: "item.ldz_240409:weapon_blaze.name" } : { translate: "item.ldz_240409:weapon_blaze.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.blaze.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.blaze.recipe", with: ['\n'] }] }),
    bogged: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBogged') ? { translate: "item.ldz_240409:weapon_bogged.name" } : { translate: "item.ldz_240409:weapon_bogged.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.bogged.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.bogged.recipe", with: ['\n'] }] }),
    breeze: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedBreeze') ? { translate: "item.ldz_240409:weapon_breeze.name" } : { translate: "item.ldz_240409:weapon_breeze.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.breeze.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.breeze.recipe", with: ['\n'] }] }),
    chicken: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedChicken') ? { translate: "item.ldz_240409:weapon_chicken.name" } : { translate: "item.ldz_240409:weapon_chicken.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.chicken.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.chicken.recipe", with: ['\n'] }] }),
    cow: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedCow') ? { translate: "item.ldz_240409:weapon_cow.name" } : { translate: "item.ldz_240409:weapon_cow.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.cow.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.cow.recipe", with: ['\n'] }] }),
    creeper: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedCreeper') ? { translate: "item.ldz_240409:weapon_creeper.name" } : { translate: "item.ldz_240409:weapon_creeper.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.creeper.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.creeper.recipe", with: ['\n'] }] }),
    enderman: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedEnderman') ? { translate: "item.ldz_240409:weapon_enderman.name" } : { translate: "item.ldz_240409:weapon_enderman.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.enderman.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.enderman.recipe", with: ['\n'] }] }),
    ender_dragon: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedEnderDragon') ? { translate: "item.ldz_240409:weapon_ender_dragon.name" } : { translate: "item.ldz_240409:weapon_ender_dragon.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.ender_dragon.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.ender_dragon.recipe", with: ['\n'] }] }),
    evoker: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedEvoker') ? { translate: "item.ldz_240409:weapon_evoker.name" } : { translate: "item.ldz_240409:weapon_evoker.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.evoker.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.evoker.recipe", with: ['\n'] }] }),
    frog: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedFrog') ? { translate: "item.ldz_240409:weapon_frog.name" } : { translate: "item.ldz_240409:weapon_frog.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.frog.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.frog.recipe", with: ['\n'] }] }),
    ghast: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedGhast') ? { translate: "item.ldz_240409:weapon_ghast.name" } : { translate: "item.ldz_240409:weapon_ghast.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.ghast.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.ghast.recipe", with: ['\n'] }] }),
    guardian: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedGuardian') ? { translate: "item.ldz_240409:weapon_guardian.name" } : { translate: "item.ldz_240409:weapon_guardian.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.guardian.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.guardian.recipe", with: ['\n'] }] }),
    iron_golem: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedIronGolem') ? { translate: "item.ldz_240409:weapon_iron_golem.name" } : { translate: "item.ldz_240409:weapon_iron_golem.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.iron_golem.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.iron_golem.recipe", with: ['\n'] }] }),
    pig: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedPig') ? { translate: "item.ldz_240409:weapon_pig.name" } : { translate: "item.ldz_240409:weapon_pig.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.pig.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.pig.recipe", with: ['\n'] }] }),
    piglin: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedPiglin') ? { translate: "item.ldz_240409:weapon_piglin.name" } : { translate: "item.ldz_240409:weapon_piglin.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.piglin.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.piglin.recipe", with: ['\n'] }] }),
    pufferfish: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedPufferfish') ? { translate: "item.ldz_240409:weapon_pufferfish.name" } : { translate: "item.ldz_240409:weapon_pufferfish.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.pufferfish.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.pufferfish.recipe", with: ['\n'] }] }),
    sheep: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSheep') ? { translate: "item.ldz_240409:weapon_sheep.name" } : { translate: "item.ldz_240409:weapon_sheep.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.sheep.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.sheep.recipe", with: ['\n'] }] }),
    skeleton: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSkeleton') ? { translate: "item.ldz_240409:weapon_skeleton.name" } : { translate: "item.ldz_240409:weapon_skeleton.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.skeleton.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.skeleton.recipe", with: ['\n'] }] }),
    slime: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSlime') ? { translate: "item.ldz_240409:weapon_slime.name" } : { translate: "item.ldz_240409:weapon_slime.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.slime.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.slime.recipe", with: ['\n'] }] }),
    spider: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedSpider') ? { translate: "item.ldz_240409:weapon_spider.name" } : { translate: "item.ldz_240409:weapon_spider.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.spider.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.spider.recipe", with: ['\n'] }] }),
    villager: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedVillager') ? { translate: "item.ldz_240409:weapon_villager.name" } : { translate: "item.ldz_240409:weapon_villager.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.villager.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.villager.recipe", with: ['\n'] }] }),
    warden: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedWarden') ? { translate: "item.ldz_240409:weapon_warden.name" } : { translate: "item.ldz_240409:weapon_warden.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.warden.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.warden.recipe", with: ['\n'] }] }),
    zombie: new utils.ButtonMenu((player) => { return utils.getScoreAsBool(player.UnsafeEntity, 'CraftedZombie') ? { translate: "item.ldz_240409:weapon_zombie.name" } : { translate: "item.ldz_240409:weapon_zombie.name_hidden" }; }, [
        {
            text: { translate: "book.ldz_240409.generic.back" },
            texture: "textures/ldz/240409/ui/back",
            onClick(player) {
                BOOK.weapons_menu.showMenuToPlayer(player);
            },
        }
    ], { rawtext: [{ translate: "book.ldz_240409.zombie.description", with: ['\n'] }, { text: "\n\n" }, { translate: "book.ldz_240409.generic.recipe_prefix", with: ['\n'] }, { translate: "book.ldz_240409.zombie.recipe", with: ['\n'] }] }),
};
