ServerEvents.recipes((event) => {
    // =========================================
    // Sophisticated Backpack and Storage Recipes
    // =========================================
  
    // Backpack

    event
      .shaped("sophisticatedbackpacks:backpack", [
        "ABA", 
        "ACA", 
        "DDD"
      ], {
        A: "supplementaries:rope",
        B: "supplementaries:sack",
        C: "#forge:chests/wooden",
        D: "minecraft:leather",
      }).id('sophisticatedbackpacks:backpack')



  
    // Backpack Upgrade Base
    event.remove({ id: "sophisticatedbackpacks:upgrade_base"});
    event
      .shaped("sophisticatedbackpacks:upgrade_base", [
        "ABA", 
        "BCB", 
        "ABA"
      ], {
        A: "supplementaries:rope",
        B: "#forge:ingots/zinc",
        C: "minecraft:leather",
      })
      .id("sophisticatedbackpacks:upgrade_base_custom");
  
    // Storage Upgrade Base
    event.remove({ id: "sophisticatedstorage:upgrade_base"});
    event
      .shaped("sophisticatedstorage:upgrade_base", [
        "ABA", 
        "BCB", 
        "ABA"
      ], {
        A: "spawn:rotten_planks",
        B: "#forge:ingots/zinc",
        C: "labels:label",
      })
      .id("sophisticatedstorage:upgrade_base_custom");
    
    // Sophisticated Controller
    event
      .shaped("sophisticatedstorage:controller", [
        "ABA", 
        "DCE", 
        "AFA"
      ], {
        A: "#warp_pipes:warp_pipes",
        B: "create:redstone_link",
        C: "#sophisticatedstorage:base_tier_wooden_storage",
        D: "nethers_exoticism:bouddha_s_hand",
        E: "crabbersdelight:pearl",
        F: "sophisticatedstorage:hopper_upgrade",
      })
      .id("sophisticatedstorage:controller");
  
    // Sophisticated Storage Link
    event.remove({ id: "sophisticatedstorage:storage_link_from_controller" });
    event.remove({ id: "sophisticatedstorage:storage_link" });
    event
      .shaped("3x sophisticatedstorage:storage_link", [
        "ABA", 
        "CDE", 
        "AFA"
      ], {
        A: "#warp_pipes:warp_pipes",
        B: "create:redstone_link",
        C: "nethers_exoticism:bouddha_s_hand",
        D: "sophisticatedstorage:controller",
        E: "crabbersdelight:pearl",
        F: "sophisticatedstorage:hopper_upgrade",
      })
      .id("sophisticatedstorage:storage_link_custom");

    // Tier 1 Upgrades Iron -> Silver
    event.replaceInput(
      { input: "#forge:ingots/iron", mod: "sophisticatedstorage" }, // Arg 1: the filter
      "#forge:ingots/iron", // Arg 2: the item to replace
      "#forge:ingots/silver" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:storage_blocks/iron", mod: "sophisticatedstorage" }, // Arg 1: the filter
      "#forge:storage_blocks/iron", // Arg 2: the item to replace
      "#forge:storage_blocks/silver" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:ingots/iron", mod: "sophisticatedbackpacks" }, // Arg 1: the filter
      "#forge:ingots/iron", // Arg 2: the item to replace
      "#forge:ingots/silver" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:storage_blocks/iron", mod: "sophisticatedbackpacks" }, // Arg 1: the filter
      "#forge:storage_blocks/iron", // Arg 2: the item to replace
      "#forge:storage_blocks/silver" // Arg 3: the item to replace it with
    );
  
    // Tier 2 Upgrades Gold -> Dawnstone
    event.replaceInput(
      { input: "#forge:ingots/gold", mod: "sophisticatedstorage" }, // Arg 1: the filter
      "#forge:ingots/gold", // Arg 2: the item to replace
      "#forge:ingots/dawnstone" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:storage_blocks/gold", mod: "sophisticatedstorage" }, // Arg 1: the filter
      "#forge:storage_blocks/gold", // Arg 2: the item to replace
      "#forge:storage_blocks/dawnstone" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:ingots/gold", mod: "sophisticatedbackpacks" }, // Arg 1: the filter
      "#forge:ingots/gold", // Arg 2: the item to replace
      "#forge:ingots/dawnstone" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:storage_blocks/gold", mod: "sophisticatedbackpacks" }, // Arg 1: the filter
      "#forge:storage_blocks/gold", // Arg 2: the item to replace
      "#forge:storage_blocks/dawnstone" // Arg 3: the item to replace it with
    );
  
    // Tier 3 Upgrades Diamond -> Enderium
    event.replaceInput(
      { input: "#forge:gems/diamond", mod: "sophisticatedstorage" }, // Arg 1: the filter
      "#forge:gems/diamond", // Arg 2: the item to replace
      "#forge:ingots/enderium" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:storage_blocks/diamond", mod: "sophisticatedstorage" }, // Arg 1: the filter
      "#forge:storage_blocks/diamond", // Arg 2: the item to replace
      "#forge:storage_blocks/enderium" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:gems/diamond", mod: "sophisticatedbackpacks" }, // Arg 1: the filter
      "#forge:gems/diamond", // Arg 2: the item to replace
      "#forge:ingots/enderium" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:storage_blocks/diamond", mod: "sophisticatedbackpacks" }, // Arg 1: the filter
      "#forge:storage_blocks/diamond", // Arg 2: the item to replace
      "#forge:storage_blocks/enderium" // Arg 3: the item to replace it with
    );
  
    // Tier 4 Upgrades Netherite -> Ostrum
    event.replaceInput(
      { input: "#forge:ingots/netherite", mod: "sophisticatedstorage" }, // Arg 1: the filter
      "#forge:ingots/netherite", // Arg 2: the item to replace
      "#forge:ingots/ostrum" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:storage_blocks/netherite", mod: "sophisticatedstorage" }, // Arg 1: the filter
      "#forge:storage_blocks/netherite", // Arg 2: the item to replace
      "#forge:storage_blocks/ostrum" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:ingots/netherite", mod: "sophisticatedbackpacks" }, // Arg 1: the filter
      "#forge:ingots/netherite", // Arg 2: the item to replace
      "#forge:ingots/ostrum" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#forge:storage_blocks/netherite", mod: "sophisticatedbackpacks" }, // Arg 1: the filter
      "#forge:storage_blocks/netherite", // Arg 2: the item to replace
      "#forge:storage_blocks/ostrum" // Arg 3: the item to replace it with
    );
  
    event.replaceInput(
      { input: "#minecraft:logs", mod: "sophisticatedstorage" }, // Arg 1: the filter
      "#minecraft:logs", // Arg 2: the item to replace
      "spawn:rotten_planks" // Arg 3: the item to replace it with
    );
  
  });
  