console.info("[SOCIETY] registerItems.js loaded");

StartupEvents.registry("item", (e) => {
  e.create("herbalbrews:water_cup")
    .texture("society:item/water_cup")
    .maxStackSize(16);
  e.create("justhammers:small_core").texture("society:item/small_core");
  e.create("buildinggadgets2:gadget_core").texture("society:item/gadget_core");

  e.create("society:tanuki_leaf")
    .texture("society:item/tanuki_leaf")
    .displayName(Text.green(":leaves: Tanuki Leaf"));
  e.create("society:architects_digest")
    .texture("society:item/architects_digest")
    .displayName(":house: Architect's Digest");
  e.create("society:fantasy_dust")
    .texture("society:item/fantasy_dust")
    .displayName(Text.yellow(":crystal_ball: Fantasy Dust"));
  e.create("society:blooming_token")
    .texture("society:item/blooming_token")
    .displayName(":shinto_shrine: Blooming Token");

  e.create("society:stone_hand").texture("society:item/stone_hand");
  e.create("society:broken_clock").texture("society:item/broken_clock");
  e.create("society:sea_biscut").texture("society:item/sea_biscut");
  e.create("society:black_opal").texture("society:item/black_opal");
  e.create("society:tiny_gnome").texture("society:item/tiny_gnome");
  e.create("society:ancient_cog").texture("society:item/ancient_cog");
  e.create("society:ancient_roe").texture("society:item/aged_roe");
  e.create("society:infinity_worm").texture("society:item/infinity_worm");
  e.create("society:frosted_tip").texture("society:item/frosted_tip");
  e.create("society:inserter").texture("society:item/inserter");
  e.create("society:blueberry")
    .texture("society:item/blueberry")
    .food((food) => {
      food.hunger(1);
      food.saturation(2);
      food.fastToEat(true);
    });
  e.create("society:tubabacco_leaf").texture("society:item/tubabacco_leaf");
  e.create("society:dried_tubabacco_leaf")
    .texture("society:item/tubabacco_leaf")
    .color(0, 0x785246);
  e.create("society:tubasmoke_stick").texture("society:item/tubasmoke_stick");
  e.create("society:tubasmoke_carton").texture("society:item/tubasmoke_carton");
  e.create("society:ancient_fruit")
    .texture("society:item/ancient_fruit")
    .food((food) => {
      food.hunger(6);
      food.saturation(3);
      food.fastToEat(true);
    });
  e.create("society:ancient_juice")
    .texture("society:item/ancient_juice")
    .food((food) => {
      food.hunger(6);
      food.fastToEat(true);
      food.saturation(12);
    })
    .useAnimation("drink");
  e.create("society:starfruit_juice")
    .texture("society:item/starfruit_juice")
    .food((food) => {
      food.hunger(6);
      food.fastToEat(true);
      food.saturation(8);
    })
    .useAnimation("drink");
  e.create("society:prize_ticket").texture("society:item/prize_ticket");
  e.create("society:furniture_box").texture("society:item/furniture_box");
  e.create("society:pine_tar").texture("society:item/pine_tar");
  e.create("society:oak_resin").texture("society:item/oak_resin");
  e.create("society:maple_syrup").texture("autumnity:item/syrup_bottle");
  e.create("society:battery").texture("society:item/battery");
  e.create("society:neptuna")
    .food((food) => {
      food.hunger(20).saturation(2).meat();
    })
    .texture("society:item/neptuna")
    .glow(true);

  e.create("numismatics:ancient_coin").texture("society:item/ancient_coin");
  e.create("numismatics:prismatic_coin").texture("society:item/prismatic_coin");

  e.create("society:elytra_wing").texture("society:item/elytra_wing");
  e.create("society:bank_meter").texture("society:item/bank_meter");
  e.create("society:car_key")
    .texture("society:item/car_key")
    .maxStackSize(1)
    .rarity("epic");
  e.create("society:kinetic_blueprint").texture(
    "society:item/kinetic_blueprint"
  );
  e.create("society:canvas")
    .texture("society:item/canvas")
    .displayName("Artisan Canvas");

  e.create("society:merino_wool").texture("society:item/merino_wool");
  e.create("society:enriched_bone_meal").texture(
    "society:item/enriched_bonemeal"
  );
  e.create("crabbersdelight:crab_trap_bait").texture(
    "society:item/crab_trap_bait"
  );
  e.create("crabbersdelight:deluxe_crab_trap_bait").texture(
    "society:item/deluxe_crab_trap_bait"
  );
  e.create("society:pig_race_ticket").texture("society:item/pig_race_ticket");
  e.create("society:multiplayer_pig_race_ticket").texture(
    "society:item/pig_race_ticket_multiplayer"
  );
  e.create("society:relic_trove").texture("society:item/relic_trove");
  e.create("society:artifact_trove").texture("society:item/artifact_trove");
  e.create("society:omni_geode").texture("society:item/omni_geode");
  e.create("society:prismatic_shard").texture("society:item/prismatic_shard");
  e.create("society:geode_buster").texture("society:item/geode_buster");
  e.create("society:geode").texture("society:item/geode/geode");

  global.geodeList.forEach((geode) => {
    if (geode.item !== "society:earth_crystal")
      e.create(`society:${geode.item.split(":")[1]}`).texture(
        `society:item/geode/${geode.item.split(":")[1]}`
      );
  });

  e.create("society:frozen_geode").texture(
    "society:item/frozen_geode/frozen_geode"
  );

  global.frozenGeodeList.forEach((geode) => {
    e.create(`society:${geode.item.split(":")[1]}`).texture(
      `society:item/frozen_geode/${geode.item.split(":")[1]}`
    );
  });
  e.create("society:magma_geode").texture(
    "society:item/magma_geode/magma_geode"
  );

  global.magmaGeodeList.forEach((geode) => {
    if (geode.item !== "society:fire_quartz")
      e.create(`society:${geode.item.split(":")[1]}`).texture(
        `society:item/magma_geode/${geode.item.split(":")[1]}`
      );
  });

  global.gems.forEach((gem) => {
    e.create(`society:${gem.item.split(":")[1]}`).texture(
      `society:item/gems/${gem.item.split(":")[1]}`
    );
  });

  global.preserves.forEach((jar) => {
    if (jar.item.includes("society"))
      e.create(`society:${jar.item.split(":")[1]}`)
        .texture(`society:item/preserves/${jar.item.split(":")[1]}`)
        .food((food) => {
          food.hunger(5);
          food.saturation(2);
          food.fastToEat(true);
          food.effect("farm_and_charm:grandmas_blessing", 6000, 1, 1.0);
        });
  });

  const ageableProductsTextureMap = [
    {
      item: "vinery:creepers_crush",
      texture: "creeper_wine",
    },
    {
      item: "vinery:villagers_fright",
      texture: "bad_omen_wine",
    },
    {
      item: "meadow:goat_cheese_block",
      texture: "wheel_of_goat_cheese",
    },
    {
      item: "meadow:cheese_block",
      texture: "wheel_of_cheese",
    },
    {
      item: "meadow:amethyst_cheese_block",
      texture: "wheel_of_amethyst_cheese",
    },
    {
      item: "meadow:warped_cheese_block",
      texture: "warped_cheese",
    },
    {
      item: "meadow:sheep_cheese_block",
      texture: "wheel_of_sheep_cheese",
    },
    {
      item: "meadow:grain_cheese_block",
      texture: "wheel_of_grain_cheese",
    },
    {
      item: "meadow:buffalo_cheese_block",
      texture: "wheel_of_herb_cheese",
    },
    {
      item: "brewery:whiskey_jojannik",
      texture: "whiskey_jo_jannik",
    },
    {
      item: "brewery:whiskey_lilitusinglemalt",
      texture: "whiskey_lilitu_single_malt",
    },
    {
      item: "brewery:whiskey_cristelwalker",
      texture: "whiskey_cristel_walker",
    },
    {
      item: "brewery:whiskey_carrasconlabel",
      texture: "whiskey_carrascon_label",
    },
    {
      item: "brewery:whiskey_smokey_reverie",
      texture: "whiskey_smoky_reverie",
    },
  ];

  global.ageableProductInputs.forEach((product) => {
    const splitProduct = product.item.split(":");
    let texturePath = `${splitProduct[0]}:item/${splitProduct[1]}`;
    ageableProductsTextureMap.find((e) => {
      if (e.item === product.item) {
        texturePath = `${splitProduct[0]}:item/${e.texture}`;
      }
    });
    if (splitProduct[0] === "society")
      texturePath = `${splitProduct[0]}:item/drinks/${splitProduct[1]}`;
    e.create(`society:aged_${splitProduct[1]}`)
      .texture(texturePath)
      .displayName(
        product.item === "brewery:whiskey_maggoallan" ||
          product.item === "brewery:whiskey_smokey_reverie"
          ? `§6Double-${product.name}`
          : `§bAged ${product.name}`
      )
      .glow(true)
      .color(0, 0xcae9f4);

    e.create(`society:double_aged_${splitProduct[1]}`)
      .texture(texturePath)
      .displayName(
        product.item === "brewery:whiskey_maggoallan" ||
          product.item === "brewery:whiskey_smokey_reverie"
          ? `§6Triple-${product.name}`
          : `§3Double-Aged ${product.name}`
      )
      .glow(true)
      .color(0, 0x28adde);
  });
  const fishTexureMapping = [
    {
      item: "unusualfishmod:raw_snowflake",
      texture: "raw_snowflake_tail_fish",
      displayId: "frosty_fin",
    },
    {
      item: "unusualfishmod:raw_bark_angelfish",
      texture: "raw_bark_angel",
      displayId: "bark_angelfish",
    },
    {
      item: "unusualfishmod:raw_eyelash",
      texture: "raw_eyelash_fish",
      displayId: "eyelash",
    },
  ];

  const fishRoeMapping = [
    { item: "aquaculture:atlantic_herring", hex: 0x8a9cab },
    { item: "minecraft:pufferfish", hex: 0xf9b00a },
    { item: "aquaculture:minnow", hex: 0x40537f },
    { item: "aquaculture:bluegill", hex: 0x327355 },
    { item: "aquaculture:perch", hex: 0x829c4d },
    { item: "minecraft:salmon", hex: 0xaa3835 },
    { item: "aquaculture:blackfish", hex: 0x6c6254 },
    { item: "aquaculture:brown_trout", hex: 0xac8c5b },
    { item: "aquaculture:carp", hex: 0x9e7150 },
    { item: "aquaculture:piranha", hex: 0x8c8b9e },
    { item: "aquaculture:smallmouth_bass", hex: 0x5da759 },
    { item: "minecraft:cod", hex: 0xcdb695 },
    { item: "aquaculture:pollock", hex: 0x777d6c },
    { item: "aquaculture:jellyfish", hex: 0xe3afe2 },
    { item: "aquaculture:rainbow_trout", hex: 0x939056 },
    { item: "aquaculture:pink_salmon", hex: 0x515133 },
    { item: "minecraft:tropical_fish", hex: 0xf17226 },
    { item: "aquaculture:red_grouper", hex: 0x5e262a },
    { item: "aquaculture:gar", hex: 0x6d774b },
    { item: "aquaculture:muskellunge", hex: 0xb1a89f },
    { item: "aquaculture:synodontis", hex: 0xbc9359 },
    { item: "aquaculture:tambaqui", hex: 0xbaac8f },
    { item: "aquaculture:atlantic_cod", hex: 0x8f8777 },
    { item: "aquaculture:boulti", hex: 0x7a6e5d },
    { item: "aquaculture:leech", hex: 0x26242b },
    { item: "aquaculture:catfish", hex: 0x61667a },
    { item: "aquaculture:tuna", hex: 0x7c7784 },
    { item: "aquaculture:bayad", hex: 0xbfc2ad },
    { item: "aquaculture:arapaima", hex: 0xa6b39b },
    { item: "aquaculture:atlantic_halibut", hex: 0x504438 },
    { item: "aquaculture:starshell_turtle", hex: 0xced2d2 },
    { item: "aquaculture:brown_shrooma", hex: 0xbca18e },
    { item: "aquaculture:red_shrooma", hex: 0xce494f },
    { item: "aquaculture:arrau_turtle", hex: 0x6c7f76 },
    { item: "aquaculture:capitaine", hex: 0xb1b07c },
    { item: "aquaculture:box_turtle", hex: 0x787b33 },
    { item: "aquaculture:pacific_halibut", hex: 0xa17e5e },
    { item: "aquaculture:goldfish", hex: 0xc3a364 },
    { item: "crabbersdelight:shrimp", hex: 0xdb4f39 },
    { item: "crabbersdelight:clawster", hex: 0x343239 },
    { item: "crabbersdelight:crab", hex: 0x40537f },
    { item: "crabbersdelight:clam", hex: 0x6ba2c1 },
    { item: "netherdepthsupgrade:searing_cod", hex: 0xe05407 },
    { item: "netherdepthsupgrade:blazefish", hex: 0xfcf244 },
    { item: "netherdepthsupgrade:lava_pufferfish", hex: 0xf80c0c },
    { item: "netherdepthsupgrade:obsidianfish", hex: 0x332b45 },
    { item: "netherdepthsupgrade:bonefish", hex: 0xd0d0d0 },
    { item: "netherdepthsupgrade:wither_bonefish", hex: 0x282828 },
    { item: "netherdepthsupgrade:magmacubefish", hex: 0xb63406 },
    { item: "netherdepthsupgrade:glowdine", hex: 0xe2c267 },
    { item: "netherdepthsupgrade:soulsucker", hex: 0x01a5aa },
    { item: "netherdepthsupgrade:fortress_grouper", hex: 0xe3851d },
    { item: "netherdepthsupgrade:eyeball_fish", hex: 0x911515 },
    { item: "society:neptuna", hex: 0x3becbe },
    { item: "unusualfishmod:raw_sneep_snorp", hex: 0x19228e },
    { item: "unusualfishmod:raw_picklefish", hex: 0x6f7a41 },
    { item: "unusualfishmod:raw_forkfish", hex: 0x9f9734 },
    { item: "unusualfishmod:raw_beaked_herring", hex: 0x718c8a },
    { item: "unusualfishmod:raw_sailor_barb", hex: 0xbac990 },
    { item: "unusualfishmod:raw_demon_herring", hex: 0xec782f },
    { item: "unusualfishmod:raw_triple_twirl_pleco", hex: 0x415668 },
    { item: "unusualfishmod:raw_copperflame_anthias", hex: 0x45c380 },
    { item: "unusualfishmod:raw_drooping_gourami", hex: 0xa61377 },
    { item: "unusualfishmod:raw_duality_damselfish", hex: 0xafb3b6 },
    { item: "unusualfishmod:raw_blind_sailfin", hex: 0xbea39a },
    { item: "unusualfishmod:raw_circus_fish", hex: 0x9b3c2b },
    { item: "unusualfishmod:raw_snowflake", hex: 0x91b2c8 },
    { item: "unusualfishmod:raw_aero_mono", hex: 0x617c92 },
    { item: "unusualfishmod:raw_hatchetfish", hex: 0xb43e5a },
    { item: "unusualfishmod:raw_spindlefish", hex: 0xf575f5 },
    { item: "unusualfishmod:raw_bark_angelfish", hex: 0x755838 },
    { item: "unusualfishmod:raw_amber_goby", hex: 0xfcae2a },
    { item: "unusualfishmod:raw_eyelash", hex: 0xdc66a0 },
  ];
  global.fish.forEach((fish) => {
    const splitFish = fish.item.split(":");
    let fishId = splitFish[1];
    if (
      ["barrel", "roe", "meat"].some((denied) => splitFish[1].includes(denied))
    )
      return;
    let baseTexturePath = `${splitFish[0]}:item/${splitFish[1]}`;
    if (fishId.includes("raw_")) {
      fishId = fishId.substring(4, fishId.length);
      fishTexureMapping.find((e) => {
        if (e.item === fish.item) {
          baseTexturePath = `${splitFish[0]}:item/${e.texture}`;
          fishId = e.displayId;
        }
      });
    }
    e.create(`society:smoked_${fishId}`)
      .texture(baseTexturePath)
      .color(0, 0x785246)
      .food((food) => {
        food.hunger(3);
        food.saturation(2);
      });
    const roeHex = fishRoeMapping.find((val) => val.item === fish.item)?.hex;
    e.create(`society:${fishId}_roe`)
      .texture("society:item/roe")
      .color(0, roeHex);
    e.create(`society:aged_${fishId}_roe`)
      .texture("society:item/aged_roe")
      .color(0, roeHex)
      .food((food) => {
        food.hunger(5);
        food.saturation(4);
      });
  });

  // Pristine gems
  global.geodeList.forEach((geode) => {
    if (geode.item === "society:froggy_helm") return;
    e.create(`society:pristine_${geode.item.split(":")[1]}`)
      .texture(`society:item/geode/${geode.item.split(":")[1]}`)
      .glow(true)
      .tooltip(Text.gray("Created from the Black Opal upgrade"));
  });

  global.frozenGeodeList.forEach((geode) => {
    if (geode.item === "society:ribbit_drum") return;
    e.create(`society:pristine_${geode.item.split(":")[1]}`)
      .texture(`society:item/frozen_geode/${geode.item.split(":")[1]}`)
      .glow(true)
      .tooltip(Text.gray("Created from the Black Opal upgrade"));
  });

  global.magmaGeodeList.forEach((geode) => {
    if (geode.item === "society:ribbit_gadget") return;
    e.create(`society:pristine_${geode.item.split(":")[1]}`)
      .texture(`society:item/magma_geode/${geode.item.split(":")[1]}`)
      .glow(true)
      .tooltip(Text.gray("Created from the Black Opal upgrade"));
  });

  global.gems.forEach((gem) => {
    e.create(`society:pristine_${gem.item.split(":")[1]}`)
      .texture(`society:item/gems/${gem.item.split(":")[1]}`)
      .glow(true)
      .tooltip(Text.gray("Created from the Black Opal upgrade"));
  });

  const vanillaPristine = [
    "minecraft:emerald",
    "minecraft:lapis_lazuli",
    "minecraft:diamond",
    "minecraft:amethyst_shard",
    "minecraft:prismarine_crystals",
    "minecraft:quartz",
  ];
  vanillaPristine.forEach((gem) => {
    e.create(`society:pristine_${gem.split(":")[1]}`)
      .texture(`minecraft:item/${gem.split(":")[1]}`)
      .glow(true)
      .tooltip(Text.gray("Created from the Black Opal upgrade"));
  });

  // Regret Crystals
  e.create(`society:crystal_of_regret_farming`)
    .displayName("Crystal of Regret: Farming")
    .texture("society:item/crystal_of_regret")
    .tooltip(
      Text.red("Right click to reset Farming skills. Refunds 5 Skill Points")
    )
    .color(0, 0x087814);

  e.create(`society:crystal_of_regret_husbandry`)
    .displayName("Crystal of Regret: Husbandry")
    .texture("society:item/crystal_of_regret")
    .tooltip(
      Text.red("Right click to reset Husbandry skills. Refunds 5 Skill Points")
    )
    .color(0, 0x4f370d);

  e.create(`society:crystal_of_regret_mining`)
    .displayName("Crystal of Regret: Mining")
    .texture("society:item/crystal_of_regret")
    .tooltip(
      Text.red("Right click to reset Mining skills. Refunds 5 Skill Points")
    )
    .color(0, 0x383735);

  e.create(`society:crystal_of_regret_fishing`)
    .displayName("Crystal of Regret: Fishing")
    .texture("society:item/crystal_of_regret")
    .tooltip(
      Text.red("Right click to reset Fishing skills. Refunds 5 Skill Points")
    )
    .color(0, 0x1eabd6);

  e.create(`society:crystal_of_regret_adventuring`)
    .displayName("Crystal of Regret: Adventuring")
    .texture("society:item/crystal_of_regret")
    .tooltip(
      Text.red(
        "Right click to reset Adventuring skills. Refunds 5 Skill Points"
      )
    )
    .color(0, 0x6e1313);

  // Artifacts
  global.artifacts.forEach((artifact) => {
    const { item } = artifact;
    if (item !== "society:princess_hairbrush") {
      e.create(item)
        .texture(`society:item/artifacts/${item.split(":")[1]}`)
        .rarity("uncommon");
    }
  });

  // Food
  e.create("herbalbrews:ground_coffee").texture("society:item/ground_coffee");
  e.create("society:steamed_milk").texture("society:item/steamed_milk");

  e.create("herbalbrews:cinnamon_coffee")
    .texture("society:item/drinks/cinnamon_coffee")
    .food((food) => {
      food.alwaysEdible(true);
      food.hunger(1);
      food.saturation(2);
      food.effect("farm_and_charm:grandmas_blessing", 2400, 0, 1.0);
    })
    .useAnimation("drink");

  e.create("herbalbrews:hazelnut_coffee")
    .texture("society:item/drinks/hazelnut_coffee")
    .food((food) => {
      food.alwaysEdible(true);
      food.hunger(1);
      food.saturation(2);
      food.effect("minecraft:resistance", 2400, 0, 1.0);
    })
    .useAnimation("drink");

  e.create("society:mocha")
    .texture("society:item/drinks/mocha")
    .food((food) => {
      food.alwaysEdible(true);
    })
    .useAnimation("drink");

  e.create("society:latte")
    .texture("society:item/drinks/latte")
    .food((food) => {
      food.alwaysEdible(true);
    })
    .useAnimation("drink");

  e.create("society:dirty_chai")
    .texture("society:item/drinks/dirty_chai")
    .food((food) => {
      food.alwaysEdible(true);
      food.effect("minecraft:speed", 2400, 1, 1.0);
      food.effect("herbalbrews:armor", 2400, 1, 1.0);
    })
    .useAnimation("drink");

  e.create("society:bowl_of_soul")
    .texture("society:item/drinks/bowl_of_soul")
    .food((food) => {
      food.alwaysEdible(true);
      food.effect("herbalbrews:excavation", 3600, 1, 1.0);
    })
    .useAnimation("drink");

  e.create("society:truffle_tea")
    .texture("society:item/drinks/truffle_tea")
    .food((food) => {
      food.alwaysEdible(true);
      food.effect("legendarycreatures:convulsion", 1600, 1, 1.0);
    })
    .tooltip(Text.darkPurple("It's said to promote relaxation."))
    .tooltip(Text.darkPurple("What do you have to lose?"))
    .useAnimation("drink");

  e.create("herbalbrews:chai_tea")
    .texture("society:item/drinks/chai_tea")
    .food((food) => {
      food.alwaysEdible(true);
      food.hunger(1);
      food.saturation(2);
      food.effect("herbalbrews:armor", 6000, 1, 1.0);
    })
    .useAnimation("drink");

  e.create("bakery:hazelnut_ella")
    .texture("society:item/hazelnut_ella")
    .food((food) => {
      food.hunger(5);
      food.saturation(2);
      food.effect("farm_and_charm:grandmas_blessing", 6000, 1, 1.0);
    });

  e.create("bakery:chocolate_donut")
    .texture("society:item/chocolate_donut")
    .food((food) => {
      food.hunger(5);
      food.saturation(2);
      food.effect("farm_and_charm:sweets", 1200, 0, 1.0);
    });

  e.create("society:ground_cinnamon").texture("society:item/ground_cinnamon");

  e.create("society:magic_rock_candy")
    .texture("society:item/magic_rock_candy")
    .rarity("epic")
    .food((food) => {
      food.hunger(20);
      food.saturation(20);
      food.effect("minecraft:haste", 6000, 2, 1.0);
      food.effect("minecraft:luck", 6000, 2, 1.0);
      food.effect("minecraft:strength", 6000, 0, 1.0);
      food.effect("minecraft:resistance", 6000, 2, 1.0);
      food.effect("farm_and_charm:sweets", 6000, 2, 1.0);
      food.effect("farm_and_charm:feast", 6000, 2, 1.0);
    });

  [
    "book_of_stars",
    "yard_work_yearly",
    "husbandry_hourly",
    "mining_monthly",
    "wet_weekly",
    "combat_quarterly",
  ].forEach((item) => {
    e.create(`society:${item}`).texture(`society:item/books/${item}`);
  });
  // Husbandry
  [
    "animal_feed",
    "milk_pail",
    "friendship_necklace",
    "fine_wool",
    "truffle",
    "truffle_oil",
    "miracle_potion",
    "magic_shears",
    "large_egg",
    "large_duck_egg",
    "large_goose_egg",
    "large_turkey_egg",
  ].forEach((item) => {
    e.create(`society:${item}`).texture(`society:item/husbandry/${item}`);
  });

  e.create("society:mayonnaise")
    .texture("society:item/mayo/mayonnaise")
    .food((food) => {
      food.hunger(10);
      food.saturation(2);
      food.effect("minecraft:nausea", 600, 1, 1.0);
    })
    .useAnimation("drink");

  const mayoEggs = [
    "duck",
    "goose",
    "turtle",
    "sniffer",
    "parrot",
    "golden",
    "dragon",
    "turkey",
  ];

  mayoEggs.forEach((egg) => {
    e.create(`society:${egg}_mayonnaise`)
      .texture(`society:item/mayo/${egg}_mayonnaise`)
      .food((food) => {
        food.hunger(10);
        food.saturation(2);
        food.effect("minecraft:nausea", 600, 1, 1.0);
      });
  });

  e.create("society:large_mayonnaise")
    .texture("society:item/mayo/large_mayonnaise")
    .food((food) => {
      food.hunger(20);
      food.saturation(2);
      food.effect("minecraft:nausea", 1200, 1, 1.0);
    })
    .useAnimation("drink");

  const largeMayoEggs = ["duck", "goose", "turkey"];
  largeMayoEggs.forEach((egg) => {
    e.create(`society:large_${egg}_mayonnaise`)
      .texture(`society:item/mayo/large_${egg}_mayonnaise`)
      .food((food) => {
        food.hunger(20);
        food.saturation(4);
        food.effect("minecraft:nausea", 1200, 1, 1.0);
      });
  });

  [
    "milk",
    "large_milk",
    "goat_milk",
    "large_sheep_milk",
    "buffalo_milk",
    "large_buffalo_milk",
    "large_goat_milk",
    "sheep_milk",
    "warped_milk",
    "large_warped_milk",
  ].forEach((item) => {
    e.create(`society:${item}`)
      .texture(`society:item/husbandry/${item}`)
      .food((food) => {
        food.hunger(item.includes("large") ? 5 : 1);
        food.saturation(2);
        food.effect("farm_and_charm:grandmas_blessing", 200, 0, 1.0);
        food.alwaysEdible(true);
      })
      .useAnimation("drink");
  });
  e.create(`society:cornucopia`).texture(`society:item/cornucopia`);
});
