import * as mc from "@minecraft/server";
import * as ui from "@minecraft/server-ui";

const GUIDEBOOK_ITEM = "pb_plane:guide_book"; //id of your guidebook item
const GUIDEBOOK_TAG = "pb_plane_book"; //tag that gets applied to the player after first book drop
const SOUND_TURN_PAGE = "item.book.page_turn";
const SOUND_OPTIONS = { pitch: 1.0, volume: 5.0 };

export const MENUS = [
  //// MAIN MENU
  {
    menuID: "pb_plane:main",
    title: "§0Airplanes Guidebook",
    body: "§7Welcome to §bAirplanes!§7\n\nSee §rTutorial§7 to get started.\n\nTry interacting with the Add-On's machines & vehicles while holding this guide for information on them!",
    buttons: [
      {
        title: "§0Tutorial",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/tutorial",
        connectID: "pb_plane:tutorial",
      },
      {
        title: "§0Content",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/content",
        connectID: "pb_plane:content",
      },
      {
        title: "§0About",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/about",
        connectID: "pb_plane:about",
      },
      {
        title: "§0Exit",
        icon: "textures/PixelBiester/Airplane/form_icons/exit_icon",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  //// TUTORIAL SECTION
  {
    menuID: "pb_plane:tutorial",
    title: "§0Tutorial",
    body: "§7Select an option below to learn more:",
    buttons: [
      {
        title: "§0Crafting",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/crafting",
        connectID: "pb_plane:crafting",
      },
      {
        title: "§0Machines",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/machines",
        connectID: "pb_plane:machines",
      },
      {
        title: "§0How to Ride",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/how_to_ride",
        connectID: "pb_plane:how_to_ride",
      },
      {
        title: "§0Customization",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/customise",
        connectID: "pb_plane:customise",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:main",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // CRAFTING
  {
    menuID: "pb_plane:crafting",
    title: "§0Crafting",
    body: "§bAirplanes§r§7 adds new crafting systems to create §rplanes§7 and other §rvehicles§7.\n\n§7To get started, you will need:\n§l§b(§e-§b)§r§7 An §rAssembler§7 multiblock, with many new crafting recipes\n\n§l§b(§e-§b)§r§7 Several §rmutliblock machines§7 to shape certain complex parts.\n\n§l§b(§e-§b)§r§7 Read about how to build them in the own sections below.",
    buttons: [
      {
        title: "§0Assembler",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/assembler",
        connectID: "pb_plane:assembler",
      },
      {
        title: "§0Multiblock Machines",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/schematic",
        connectID: "pb_plane:multiblock_machines",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:tutorial",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // CRAFTING - ASSEMBLER
  {
    menuID: "pb_plane:assembler",
    title: "§0Assembler",
    body: "§7The §bAssembler§7 is a multiblock §rcrafting table§7. To form the multiblock, place 4 §bAssembly Cores§7 next to each other in a §r2x2 formation§7.\n\n§l§b(§e-§b)§r§7 When done correctly, it will transform visually.\n\n§l§b(§e-§b)§r§7 §bInteract§7 with it to open the crafting UI.\n\n§l§b(§e-§b)§r§7 It is used to craft §rmachines§7, §rvehicle parts§7 and §rvehicles§7.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:crafting",
      },
    ],
    type: "form",
    openOnBlock: ["pb_plane:assembly_core"],
    openOnEntity: [],
  },
  // CRAFTING - MACHINES
  {
    menuID: "pb_plane:multiblock_machines",
    title: "§0Mutliblock Machines",
    body: "§7All other multiblock machines are built up in the same way.\n\n§l§b(§e-§b)§r§7 To build them, you need the §rMachine Module§7 and two §rMachine Cores§7.\n\n§l§b(§e-§b)§r§7 Place the §rmodule§7 & place a §rmachine core§7 to its left & right, all facing the same way.\n\n§7[§cC§7][§6M§7][§cC§7]§r\n\n§7[§cC§7]§r = §cMachine Cores§r\n§7[§6M§7]§r = §6Module§r\n\n§l§b(§e-§b)§r§7 If done correctly, it will transform visibly.\n\n§l§b(§e-§b)§r§7 The machine is now functional. Read how to use them in the §bmachines§7 section.",
    buttons: [
      {
        title: "§0Machines",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/machines",
        connectID: "pb_plane:machines",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:crafting",
      },
    ],
    type: "form",
    openOnBlock: ["pb_plane:module_schematic"],
    openOnEntity: [],
  },
  // CRAFTING
  {
    menuID: "pb_plane:crafting",
    title: "§0Crafting",
    body: "§bAirplanes§r§7 adds new crafting systems to create §rplanes§7 and other §rvehicles§7.\n\n§7To get started, you will need:\n§l§b(§e-§b)§r§7 An §rAssembler§7 multiblock, with many new crafting recipes\n\n§l§b(§e-§b)§r§7 Several §rmutliblock machines§7 to shape certain complex parts.\n\n§l§b(§e-§b)§r§7 Read about how to build them in the own sections below.",
    buttons: [
      {
        title: "§0Assembler",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/assembler",
        connectID: "pb_plane:assembler",
      },
      {
        title: "§0Multiblock Machines",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/schematic",
        connectID: "pb_plane:machines",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:tutorial",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // MACHINES
  {
    menuID: "pb_plane:machines",
    title: "§0Machines",
    body: "§7Choose a §rMachine§r.",
    buttons: [
      {
        title: "§0Schematic Creator",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/schematic",
        connectID: "pb_plane:schematic",
      },
      {
        title: "§0Metal Bender",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/bender",
        connectID: "pb_plane:bender",
      },
      {
        title: "§0Centrifuge",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/centrifuge",
        connectID: "pb_plane:centrifuge",
      },
      {
        title: "§0Condenser",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/condenser",
        connectID: "pb_plane:condenser",
      },
      {
        title: "§0Sewing Machine",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/sewing",
        connectID: "pb_plane:sewing",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:tutorial",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // CRAFTING - SCHEMATIC
  {
    menuID: "pb_plane:schematic",
    title: "§0Schematic Creator",
    body: "§7The §bSchematic Creator§7 is a multiblock structure that drafts §rvehicle schematics§7.\n\n§l§b(§e-§b)§r§7 Interact with it to select a §rschematic§7 and draft it.\n\n§l§b(§e-§b)§r§7 §rSchematics§7 don't cost any resource.\n\n§l§b(§e-§b)§r§7 They're required to craft §rplanes§7 & §rvehicles§7 in the final assembly stage.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:machines",
      },
    ],
    type: "form",
    openOnBlock: ["pb_plane:module_schematic"],
    openOnEntity: [],
  },
  // CRAFTING - METAL BENDER
  {
    menuID: "pb_plane:bender",
    title: "§0Metal Bender",
    body: "§7The §bMetal Bender§7 is a multiblock structure that processes metal parts.\n\n§l§b(§e-§b)§r§7 Interact with it with §rcertain items§7 to process them further.\n\n§bAccepted Recipes:\n§l§b(§e-§b)§r§7 Iron Ingot §e->§7 Iron Plate\n§l§b(§e-§b)§r§7 Gold Ingot §e->§7 Gold Plate\n§l§b(§e-§b)§r§7 Iron Plate §e->§7 Rotator§r",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:machines",
      },
    ],
    type: "form",
    openOnBlock: ["pb_plane:module_bender"],
    openOnEntity: [],
  },
  // CRAFTING - CENTRIFUGE
  {
    menuID: "pb_plane:centrifuge",
    title: "§0Centrifuge",
    body: "The §bCentrifuge§7 is a multiblock structure which that processes latex and redstonium.\n\n§l§b(§e-§b)§r§7 Interact with it with §rcertain items§7 to process them further.\n\n§bAccepted Recipes:\n§l§b(§e-§b)§r§7 Dandelion §e->§7 Latex\n§l§b(§e-§b)§r§7 Redstone Dust §e->§7 Redstonium§r",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:machines",
      },
    ],
    type: "form",
    openOnBlock: ["pb_plane:module_centrifuge"],
    openOnEntity: [],
  },
  // CRAFTING - CONDENSER
  {
    menuID: "pb_plane:condenser",
    title: "§0Condenser",
    body: "§7The §bCondenser§r is a multiblock structure that processes organic materials into biofuel.\n\n§l§b(§e-§b)§r§7 To be able to proccess materials, it will need a §bfuel tank§7 behind the main §rcondenser module§r.\n\n§l§b(§e-§b)§r§7 Interact with it with organic items (seeds, crops, leaves, etc.) to process them into fuel that slowly fills the tank.\n\n§l§b(§e-§b)§r§7 Each material you feed it only has a chance to fill the tank, so filling all 8 levels will take longer.",
    buttons: [
      {
        title: "§0Fuel Tank",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/fuel_tank",
        connectID: "pb_plane:fuel_tank",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:machines",
      },
    ],
    type: "form",
    openOnBlock: ["pb_plane:module_condenser"],
    openOnEntity: [],
  },
  // CRAFTING - CONDENSER - FUEL TANK
  {
    menuID: "pb_plane:fuel_tank",
    title: "§0Fuel Tank",
    body: "§7The §bFuel Tank§r is used to store biofuel processed in the condenser.\n\n§l§b(§e-§b)§r§7 You can safely §rbreak§7 the fuel tank when it has fuel inside and it will store its contents.\n\n§l§b(§e-§b)§r§7To extract the fuel, interact with a §rfull fuel tank§7 while holding an §rEmpty Fuel Can§7, which will empty the tank, and give you a §2Full Fuel Can§r",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:condenser",
      },
    ],
    type: "form",
    openOnBlock: ["pb_plane:fuel_tank"],
    openOnEntity: [],
  },
  // CRAFTING - SEWING MACHINE
  {
    menuID: "pb_plane:sewing",
    title: "§0Sewing Machine",
    body: "§7The §bSewing Machine§7 is a multiblock structure that processes wool blocks into cloth.\n\n§l§b(§e-§b)§r§7 Interact with it with §rcertain items§7 to process them further.\n\n§bAccepted Recipes:\n§l§b(§e-§b)§r§7 Wool §e->§7 Ballon Cloth",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:machines",
      },
    ],
    type: "form",
    openOnBlock: ["pb_plane:module_sewing_machine"],
    openOnEntity: [],
  },
  // HOW TO RIDE
  {
    menuID: "pb_plane:how_to_ride",
    title: "§0How To Ride",
    body: "§7To ride any of the §rvehicles§7, §rinteract§7 with them to get in, or §rsneak§7 to exit.\n\nTo drive, you will need a §bfull fuel can§7 in the §rtop left slot§7 of the vehicle's inventory. Check the §rcondensor§7 section in the §rmachines§7 section of the §rcrafting guide§7\n\n§l§b(§e-§b)§r§7 Some vehicles are too big to access the fuel slot, so you will have to §rsneak and interact§7 with it to open the inventory from outside.\n\n§l§b(§e-§b)§r§7 Fuel will slowly §rdeplete§7 as you fly/drive your vehicle.\n\n§l§b(§e-§b)§r§7 For more information control, please select an option below:",
    buttons: [
      {
        title: "§0Planes",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_ride/planes",
        connectID: "pb_plane:ride_planes",
      },
      {
        title: "§0Helicopters",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_ride/helicopters",
        connectID: "pb_plane:ride_helicopters",
      },
      {
        title: "§0Other Flyables",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_ride/other",
        connectID: "pb_plane:ride_other",
      },
      {
        title: "§0Cars",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_ride/cars",
        connectID: "pb_plane:ride_cars",
      },
      {
        title: "§0Boats",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_ride/boats",
        connectID: "pb_plane:ride_boats",
      },
      {
        title: "§0Balloons",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_ride/balloons",
        connectID: "pb_plane:ride_balloons",
      },
      {
        title: "§0Hover Vehicles",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_ride/hovers",
        connectID: "pb_plane:ride_hover",
      },
      {
        title: "§0UFO",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_ride/ufos",
        connectID: "pb_plane:ride_ufo",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:tutorial",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HOW TO RIDE - PLANES
  {
    menuID: "pb_plane:ride_planes",
    title: "§0Planes",
    body: "§7To begin moving in a plane, hold down your §rjump§7 button.\n\nYou will slowly accelerate until you get to §btake-off§7 speed§r, at which point you can §rlook up§7 to take off.\n\nTo control the plane, §rlook§7 in the direction you wish to steer.\n\n§l§b(§e-§b)§r§7 Fly upwards by holding jump\n\n§l§b(§e-§b)§r§7 Releasing §rJump§7 or running out of fuel will make the plane glide and slowly descend.\n\n§l§b(§e-§b)§r§7 Some planes can perform §rtricks§7 by double-tapping jump.\n\n§l§b(§e-§b)§r§7 Performing a §rtrick§7 gives a small §rspeed boost§7.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:how_to_ride",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HOW TO RIDE - HELICOPTERS
  {
    menuID: "pb_plane:ride_helicopters",
    title: "§0Helicopters",
    body: "§7To take off in a §rhelicopter§7, hold the §bjump button§7.\n\nYou can move the helicopter in the air by using §bmovement controls§r.\n\n§l§b(§e-§b)§r§7 Enable §bhover mode§r by §rdouble tapping§7 §rjump\n\n§7§l§b(§e-§b)§r§7 Deactivate §bhover mode§7 by tapping §rjump§7 once.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:how_to_ride",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HOW TO RIDE - OTHER FLYABLES - BLIMP AND DRONE
  {
    menuID: "pb_plane:ride_other",
    title: "§0Other Flyables",
    body: "§7To take off in a §bBlimp§7 or §bDrone§7, hold the §3jump button§r.\n\nYou can move them in the air by using §bmovement controls§r.\n\n§l§b(§e-§b)§r§7 Enable §bhover mode§r by §rdouble tapping§7 §rjump.\n\n§7§l§b(§e-§b)§r§7 Deactivate §bhover mode§7 by tapping §rjump§7 once.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:how_to_ride",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HOW TO RIDE - CARS
  {
    menuID: "pb_plane:ride_cars",
    title: "§0Cars",
    body: "§7To drive §rground vehicles§7, use your §rmovement controls§7.\n\n§l§b(§e-§b)§r§7 Enable §bsirens§r by §rdouble tapping§7 §rjump.\n\n§l§b(§e-§b)§r§7 Can ascend 1 block gaps.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:how_to_ride",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HOW TO RIDE - BOATS
  {
    menuID: "pb_plane:ride_boats",
    title: "§0Boats",
    body: "§7To drive §raquatic vehicles§7, use your §rmovement controls§7.\n\n§l§b(§e-§b)§r§7 Only works in water.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:how_to_ride",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HOW TO RIDE - BALLOONS
  {
    menuID: "pb_plane:ride_balloons",
    title: "§0Balloons",
    body: "§7To take off in a §bHot Air Balloon§7, hold the §3jump button§r.\n\nYou can move them in the air by using §bmovement controls§r.\n\n§l§b(§e-§b)§r§7 Enable §bhover mode§r by §rdouble tapping§7 §rjump.\n\n§7§l§b(§e-§b)§r§7 Deactivate §bhover mode§7 by tapping §rjump§7 once.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:how_to_ride",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HOW TO RIDE - HOVERS
  {
    menuID: "pb_plane:ride_hover",
    title: "§0Hover Vehicles",
    body: "§7To take off in a §bHover Vehicle§7, hold the §3jump button§r.\n\nYou can move them in the air by using §bmovement controls§r.\n\n§l§b(§e-§b)§r§7 Enable §bhover mode§r by §rdouble tapping§7 §rjump.\n\n§7§l§b(§e-§b)§r§7 Deactivate §bhover mode§7 by tapping §rjump§7 once.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:how_to_ride",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HOW TO RIDE - UFO
  {
    menuID: "pb_plane:ride_ufo",
    title: "§0UFO",
    body: "§7To take off in a §bUFO§7, hold the §3jump button§r.\n\nYou can move them in the air by using §bmovement controls§r.\n\n§l§b(§e-§b)§r§7 Enable §bhover mode§r by §rdouble tapping§7 §rjump.\n\n§7§l§b(§e-§b)§r§7 Deactivate §bhover mode§7 by tapping §rjump§7 once.\n\n§7§l§b(§e-§b)§r§7 The UFO also has a §btractor beam§7, which can pick-up and carry most mobs, item crates, and even items. To activate, simply press interact whilst flying the UFO, and the first entity found within range will be sucked up.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:how_to_ride",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // CUSTOMISATION
  {
    menuID: "pb_plane:customise",
    title: "§0Customization",
    body: "§7You can customize your §bvehicles§7 with §rDecals§7, §rSpray Paint§7, or the §rCustomization Kit§7.\n\n§l§b(§e-§b)§r§7 Customizations persist after picking vehicles up.\n\n§l§b(§e-§b)§r§7 Check below for more.",
    buttons: [
      {
        title: "§0Decals",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/decal",
        connectID: "pb_plane:decals",
      },
      {
        title: "§0Spray Paint",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/spray_paint",
        connectID: "pb_plane:spray_paint",
      },
      {
        title: "§0Customization Kit",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/custom_kit",
        connectID: "pb_plane:customisation_kit",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:tutorial",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // CUSTOMISATION - DECALS
  {
    menuID: "pb_plane:decals",
    title: "§0Decals",
    body: "§bDecals§7 can be crafted at the Assembler. Apply them to a vehicle to apply the decal style.\n\n§l§b(§e-§b)§r§7 There are 3 different §rdecal§7 styles.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:customise",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // CUSTOMISATION - SPRAY PAINT
  {
    menuID: "pb_plane:spray_paint",
    title: "§0Spray Paint",
    body: "§bSpray Paint§7 can be crafted at the Assembler. Apply them to a vehicle to change their color scheme.\n\n§l§b(§e-§b)§r§7 There are §b16§7 different colors.\n\n§l§b(§e-§b)§r§7 Some §rvehicles§7 have 2 changeable colors. Check which ones in the §rcontent§7 section.\n\n§l§b(§e-§b)§r§7 Apply the §r2nd color§7 by interacting while sneaking.\n\n§l§b(§e-§b)§r§7 To remove all colors from a vehicle, apply a §rwater bucket§7.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:customise",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // CUSTOMISATION - CUSTOMISATION KIT
  {
    menuID: "pb_plane:customisation_kit",
    title: "§0Customization Kit",
    body: "§7The §bCustomization Kit§7 allows all-in customization with a single device.\n\n§l§b(§e-§b)§r§7 Apply it to a §rvehicle§7 to bring up the customization menu.\n\n§l§b(§e-§b)§r§7 Can change colors in §rbasic§7 and §rcomplex§7 mode.\n\n§l§b(§e-§b)§r§7 §rcomplex§7 mode requires entering a §bhexadecimal§7 color code via slider menus.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:customise",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  //// CONTENT SECTION
  {
    menuID: "pb_plane:content",
    title: "§0Content",
    body: "§7Choose a vehicle type:",
    buttons: [
      {
        title: "§0Planes",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/planes",
        connectID: "pb_plane:planes",
      },
      {
        title: "§0Helicopters",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/helicopters",
        connectID: "pb_plane:helicopters",
      },
      {
        title: "§0Other Flyables",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/others",
        connectID: "pb_plane:other",
      },
      {
        title: "§0Balloons",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/balloons",
        connectID: "pb_plane:balloons",
      },
      {
        title: "§0Hover Vehicles",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/hovers",
        connectID: "pb_plane:hovers",
      },
      {
        title: "§0UFO",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/ufos",
        connectID: "pb_plane:ufos",
      },
      {
        title: "§0Cars",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/cars",
        connectID: "pb_plane:cars",
      },
      {
        title: "§0Boats",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/boats",
        connectID: "pb_plane:boats",
      },
      {
        title: "§0Parachute",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/parachute",
        connectID: "pb_plane:parachute",
      },
      {
        title: "§0Transport Crates",
        icon: "textures/PixelBiester/Airplane/form_icons/guide/crates",
        connectID: "pb_plane:crates",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:main",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  //// CONTENT SECTION - PLANES
  {
    menuID: "pb_plane:planes",
    title: "§0Planes",
    body: "§7Select a Plane",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
      {
        title: "§0Airtrike",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/airtrike",
        connectID: "pb_plane:airtrike",
      },
      {
        title: "§0Air Tractor",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/air_tractor",
        connectID: "pb_plane:air_tractor",
      },
      {
        title: "§0Biplane",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/biplane",
        connectID: "pb_plane:biplane",
      },
      {
        title: "§0Skyhawk",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/skyhawk",
        connectID: "pb_plane:skyhawk",
      },
      {
        title: "§0Cadanair",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/cadanair",
        connectID: "pb_plane:cadanair",
      },
      {
        title: "§0Cruiser",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/cruiser",
        connectID: "pb_plane:cruiser",
      },
      {
        title: "§0Ember 120",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/ember_120",
        connectID: "pb_plane:ember_120",
      },
      {
        title: "§0Magister",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/magister",
        connectID: "pb_plane:magister",
      },
      {
        title: "§0Gilbert",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/gilbert",
        connectID: "pb_plane:gilbert",
      },
      {
        title: "§0Glider",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/glider",
        connectID: "pb_plane:glider",
      },
      {
        title: "§0Galapagos",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/galapagos",
        connectID: "pb_plane:galapagos",
      },
      {
        title: "§0Northstar",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/northstar",
        connectID: "pb_plane:northstar",
      },
      {
        title: "§0Wooden Plane",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/wooden",
        connectID: "pb_plane:wooden",
      },
      {
        title: "§0Lightning",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/lightning",
        connectID: "pb_plane:lightning",
      },
      {
        title: "§0Passenger Jet",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/passenger_jet",
        connectID: "pb_plane:passenger_jet",
      },
      {
        title: "§0Ricarde",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/ricarde",
        connectID: "pb_plane:ricarde",
      },
      {
        title: "§0Sea Plane",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/seaplane",
        connectID: "pb_plane:seaplane",
      },
      {
        title: "§0Marine",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/marine",
        connectID: "pb_plane:marine",
      },
      {
        title: "§0Triplane",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/triplane",
        connectID: "pb_plane:triplane",
      },
      {
        title: "§0Vampire",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/vampire",
        connectID: "pb_plane:vampire",
      },
      {
        title: "§0Flying Car",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_planes/flying_car",
        connectID: "pb_plane:flying_car",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // PLANES - AIRTRIKE
  {
    menuID: "pb_plane:airtrike",
    title: "§0Airtrike",
    body: "§pModel:§r §oAirtrike§r\n\n§pDescription:\n§r§oMotorized Glider§r\n\n§cSpeed:         [][][]§r[][][][][][][]\n§2Take Off:      [][][]§r[][][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§cNO§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_airtrike"],
  },
  // PLANES - AIR TRACTOR
  {
    menuID: "pb_plane:air_tractor",
    title: "§0Air Tractor",
    body: "§pModel:§r §oAir Tractor§r\n\n§pDescription:§r §o\nBasic Plane§r\n\n§cSpeed:         [][][][]§r[][][][][][]\n§2Take Off:      [][][][]§r[][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r2\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_air_tractor"],
  },
  // PLANES - BIPLANE
  {
    menuID: "pb_plane:biplane",
    title: "§0Biplane",
    body: "§pModel:§r §oBiplane§r\n\n§pDescription:§r §o\nDouble-Winged Plane§r\n\n§cSpeed:         [][][][]§r[][][][][][]\n§2Take Off:      [][][][][]§r[][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_biplane"],
  },
  // PLANES - Skyhawk
  {
    menuID: "pb_plane:skyhawk",
    title: "§0Skyhawk",
    body: "§pModel:§r §oSkyhawk§r\n\n§pDescription:§r §o\nWing Propeller ModelE§r\n\n§cSpeed:         [][][][][][]§r[][][][]\n§2Take Off:      [][][]§r[][][][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][][][]§r[][][][][][]\n\n§3Color Layers: §r2\n\n§5Trick:           §r[§cNO§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_skyhawk"],
  },
  // PLANES - Cadanair
  {
    menuID: "pb_plane:cadanair",
    title: "§0Cadanair",
    body: "§pModel:§r §oCadanair§r\n\n§pDescription:§r §o\nLarge firefighting plane§r\n\n§cSpeed:         [][][]§r[][][][][][][]\n§2Take Off:      [][][][][][][][][][]§r\n§9Passengers:  [][][][][][]§r[][][][]\n§6Storage:       [][][][][][][][][][]§r\n\n§3Color Layers: §r2\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_cadanair"],
  },
  // PLANES - CRUISER
  {
    menuID: "pb_plane:cruiser",
    title: "§0Cruiser",
    body: "§pModel:§r §oCruiser§r\n\n§pDescription:§r §o\nBasic Plane§r\n\n§cSpeed:         [][][][][][]§r[][][][]\n§2Take Off:      [][][][][]§r[][][][][]\n§9Passengers:  [][][][]§r[][][][][][]\n§6Storage:       [][][][]§r[][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_cruiser"],
  },
  // PLANES - Ember 120
  {
    menuID: "pb_plane:ember_120",
    title: "§0Ember 120",
    body: "§pModel:§r §oEmber 120§r\n\n§pDescription:§r §o\nLarge Passenger Plane§r\n\n§cSpeed:         [][][][]§r[][][][][][]\n§2Take Off:      [][][][][][][][]§r[][]\n§9Passengers:  [][][][][][][][][][]§r++\n§6Storage:       [][][][][][]§r[][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§cNO§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_ember_120"],
  },
  // PLANES - Magister
  {
    menuID: "pb_plane:magister",
    title: "§0Magister",
    body: "§pModel:§r §oMagister§r\n\n§pDescription:§r §o\nBasic Jet§r\n\n§cSpeed:         [][][][][][][][][][]§r\n§2Take Off:      []§r[][][][][][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_magister"],
  },
  // PLANES - GILMORE
  {
    menuID: "pb_plane:gilbert",
    title: "§0Gilbert",
    body: "§pModel:§r §oGilbert§r\n\n§pDescription:§r §o\nCylinder Plane§r\n\n§cSpeed:         [][][][][][][][]§r[][]\n§2Take Off:      [][]§r[][][][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r2\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_gilbert"],
  },
  // PLANES - GLIDER
  {
    menuID: "pb_plane:glider",
    title: "§0Glider",
    body: "§pModel:§r §oGlider§r\n\n§pDescription:§r §o\nWide-winged Plane§r\n\n§cSpeed:         [][][][][]§r[][][][][]\n§2Take Off:      [][]§r[][][][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§cNO§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_glider"],
  },
  // PLANES - HAVILLAND
  {
    menuID: "pb_plane:galapagos",
    title: "§0Galapagos",
    body: "§pModel:§r §oGalapagos§r\n\n§pDescription:§r §o\nLarge Double Propeller§r\n\n§cSpeed:         [][][][][][][][][]§r[]\n§2Take Off:      [][][]§r[][][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_galapagos"],
  },
  // PLANES - NORTHROP
  {
    menuID: "pb_plane:northstar",
    title: "§0Northstar",
    body: "§pModel:§r §oNorthstar§r\n\n§pDescription:§r §o\nTriangle Glider§r\n\n§cSpeed:         [][][][][][][]§r[][][]\n§2Take Off:      [][][][][]§r[][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r2\n\n§5Trick:           §r[§cNO§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_northstar"],
  },
  // PLANES - OLD
  {
    menuID: "pb_plane:wooden",
    title: "§0Wooden Plane",
    body: "§pModel:§r §oWooden Plane§r\n\n§pDescription:§r §o\nArchaic Plane§r\n\n§cSpeed:         [][][]§r[][][][][][][]\n§2Take Off:      [][][][][][][]§r[][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       §r[][][][][][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§cNO§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_wooden"],
  },
  // PLANES - Lightning
  {
    menuID: "pb_plane:lightning",
    title: "§0Lightning",
    body: "§pModel:§r §oLightning§r\n\n§pDescription:§r §oDouble-tailed Plane§r\n\n§cSpeed:         [][][][][][][][]§r[][]\n§2Take Off:      [][]§r[][][][][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§c§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_lightning"],
  },
  // PLANES - PASSENGER JET
  {
    menuID: "pb_plane:passenger_jet",
    title: "§0Passenger Jet",
    body: "§pModel:§r §oPassenger Jet§r\n\n§pDescription:§r §oLarge Passenger Jet§r\n\n§cSpeed:         [][][][]§r[][][][][][]\n§2Take Off:      [][][][][][][][][]§r[]\n§9Passengers:  [][][][][][][][][][]§r++\n§6Storage:       [][][][][][][][][][]§r\n\n§3Color Layers: §r2\n\n§5Trick:           §r[§cNO§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_passenger_jet"],
  },
  // PLANES - RAFALE
  {
    menuID: "pb_plane:ricarde",
    title: "§0Ricarde",
    body: "§pModel:§r §oRicarde§r\n\n§pDescription:§r §o\nQuick Jet§r\n\n§cSpeed:         [][][][][][][][][][]§r\n§2Take Off:      []§r[][][][][][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_ricarde"],
  },
  // PLANES - SEAPLANE
  {
    menuID: "pb_plane:seaplane",
    title: "§0Seaplane",
    body: "§pModel:§r §oSeaplane§r\n\n§pDescription:§r §o\nBasic Seaplane§r\n\n§cSpeed:         [][][][]§r[][][][][][]\n§2Take Off:      [][][][]§r[][][][][][]\n§9Passengers:  [][][][]§r[][][][][][]\n§6Storage:       [][][][]§r[][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_seaplane"],
  },
  // PLANES - SUPERMARINE
  {
    menuID: "pb_plane:marine",
    title: "§0Marine",
    body: "§pModel:§r §oMarine§r\n\n§pDescription:§r §o\nBasic Plane§r\n\n§cSpeed:         [][][][][][][][]§r[][]\n§2Take Off:      [][]§r[][][][][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r2\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_marine"],
  },
  // PLANES - TRIPLANE
  {
    menuID: "pb_plane:triplane",
    title: "§0Triplane",
    body: "§pModel:§r §oTriplane§r\n\n§pDescription:§r §o\nTriple-Winged Plane§r\n\n§cSpeed:         [][][][][]§r[][][][][]\n§2Take Off:      [][][][]§r[][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§cNO§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_triplane"],
  },
  // PLANES - VAMPIRE
  {
    menuID: "pb_plane:vampire",
    title: "§0Vampire",
    body: "§pModel:§r §oVampire§r\n\n§pDescription:§r §o\nDouble-Tailed Plane§r\n\n§cSpeed:         [][][][][][][][][][]§r\n§2Take Off:      []§r[][][][][][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][][][]§r[][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§aYES§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_vampire"],
  },
  // PLANES - FLYING CAR
  {
    menuID: "pb_plane:flying_car",
    title: "§0Flying Car",
    body: "§pModel:§r §oFlying Car§r\n\n§pDescription:§r §o\nIs it a car, is it a plane?§r\n\n§cSpeed:         [][][][]§r[][][][][][]\n§2Take Off:      [][][][]§r[][][][][][]\n§9Passengers:  [][][][]§r[][][][][][]\n§6Storage:       [][][][]§r[][][][][][]\n\n§3Color Layers: §r1\n\n§5Trick:           §r[§cNO§r]",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:planes",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:plane_flying_car"],
  },
  //// CONTENT SECTION - HELICOPTERS
  {
    menuID: "pb_plane:helicopters",
    title: "§0Helicopters",
    body: "§7Select a Helicopter",
    buttons: [
      {
        title: "§0Cargo",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_helicopters/cargo",
        connectID: "pb_plane:cargo",
      },
      {
        title: "§0Leopard",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_helicopters/leopard",
        connectID: "pb_plane:leopard",
      },
      {
        title: "§0Remedy",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_helicopters/remedy",
        connectID: "pb_plane:remedy",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HELICOPTERS - CARGO
  {
    menuID: "pb_plane:cargo",
    title: "§0Cargo",
    body: "§pModel:§r §oCargo§r\n\n§pDescription:§r §o\nLarge Cargo Helicopter§r\n\n§cSpeed:         [][][]§r[][][][][][][]\n§9Passengers:  [][][]§r[][][][][][][]\n§6Storage:       [][][][][][][][][][]\n\n§3Color Layers: §r2§r\n\n\n§l§b(§e-§b)§r§7This §rHelicopter§7 can lift and transport §bCargo Crates§7.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:helicopters",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:heli_cargo"],
  },
  // HELICOPTERS - LYNX
  {
    menuID: "pb_plane:leopard",
    title: "§0Leopard",
    body: "§pModel:§r §oLeopard§r\n\n§pDescription:§r §o\nBasic Helicopter§r\n\n§cSpeed:         [][][][][]§r[][][][][]\n§9Passengers:  [][][][][][]§r[][][][]\n§6Storage:       [][][][][][][][]§r[][]\n\n§3Color Layers: §r2",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:helicopters",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:heli_leopard"],
  },
  // HELICOPTERS - SOLUTION
  {
    menuID: "pb_plane:remedy",
    title: "§0Remedy",
    body: "§pModel:§r §oRemedy§r\n\n§pDescription:§r §o\nBasic Helicopter§r\n\n§cSpeed:         [][][][][][][]§r[][][]\n§9Passengers:  [][][][]§r[][][][][][]\n§6Storage:       [][][][][][]§r[][][][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:helicopters",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:heli_remedy"],
  },
  //// CONTENT SECTION - OTHER FLYABLES
  {
    menuID: "pb_plane:other",
    title: "§0Other Flyables",
    body: "§7Select a Vehicle",
    buttons: [
      {
        title: "§0Blimp - Zeppelin",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_other/zeppelin",
        connectID: "pb_plane:zeppelin",
      },
      {
        title: "§0Drone - Passenger",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_other/passenger",
        connectID: "pb_plane:passenger",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // OTHERS - ZEPPELIN
  {
    menuID: "pb_plane:zeppelin",
    title: "§0Blimp - Zeppelin",
    body: "§pModel:§r §oZeppelin Blimp§r\n\n§pDescription:§r §oLarge Zeppelin§r\n\n§cSpeed:         [][]§r[][][][][][][][]\n§9Passengers:  [][][][][][]§r[][][][]\n§6Storage:       [][][][][][][][]§r[][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:other",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:blimp_zeppelin"],
  },
  // OTHERS - PASSENGER DRONE
  {
    menuID: "pb_plane:passenger",
    title: "§0Drone - Passenger",
    body: "§pModel:§r §oPassenger Drone§r\n\n§pDescription:§r §oSteerable DroneE§r\n\n§cSpeed:         [][][][][][][][]§r[][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][][][]§r[][][][][][]\n\n§3Color Layers: §r1\n\n\n§l§b(§e-§b)§r§7This §rDrone§7 can lift and transport §bItem Crates§7.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:other",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:drone_passenger"],
  },
  //// CONTENT SECTION - BALLOONS
  {
    menuID: "pb_plane:balloons",
    title: "§0Balloons",
    body: "§7Select a Vehicle",
    buttons: [
      {
        title: "§0Hot Air Balloon",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_balloons/balloon_1",
        connectID: "pb_plane:balloon",
      },
      {
        title: "§0Creeper Balloon",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_balloons/balloon_2",
        connectID: "pb_plane:creeper_balloon",
      },
      {
        title: "§0Cactus Balloon",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_balloons/balloon_3",
        connectID: "pb_plane:cactus_balloon",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // BALLOONS - HOT AIR BALLOON
  {
    menuID: "pb_plane:balloon",
    title: "§0Hot Air Balloon",
    body: "§pModel:§r §oHot Air Balloon§r\n\n§pDescription:§r §oStandard Hot Air Balloon§r\n\n§cSpeed:         [][][]§r[][][][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r2",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:balloons",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:balloon_1"],
  },
  // BALLOONS - CREEPER BALLOON
  {
    menuID: "pb_plane:creeper_balloon",
    title: "§0Creeper Balloon",
    body: "§pModel:§r §oCreeper Balloon§r\n\n§pDescription:§r §oCreeper Themed Hot Air Balloon§r\n\n§cSpeed:         [][][]§r[][][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r2",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:balloons",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:balloon_2"],
  },
  // BALLOONS - CACTUS BALLOON
  {
    menuID: "pb_plane:cactus_balloon",
    title: "§0Cactus Balloon",
    body: "§pModel:§r §oCactus Balloon§r\n\n§pDescription:§r §oCactus Themed Hot Air Balloon§r\n\n§cSpeed:         [][][]§r[][][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:balloons",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:balloon_3"],
  },
  //// CONTENT SECTION - HOVERS
  {
    menuID: "pb_plane:hovers",
    title: "§0Hover Vehicles",
    body: "§7Select a Vehicle",
    buttons: [
      {
        title: "§0Tuktuk",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_hovers/tuktuk",
        connectID: "pb_plane:tuktuk",
      },
      {
        title: "§0Tuk-Van",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_hovers/tukvan",
        connectID: "pb_plane:tukvan",
      },
      {
        title: "§0Bike",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_hovers/bike",
        connectID: "pb_plane:bike",
      },
      {
        title: "§0Vespa",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_hovers/vespa",
        connectID: "pb_plane:vespa",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // HOVERS - TUKTUK
  {
    menuID: "pb_plane:tuktuk",
    title: "§0Hover Tuktuk",
    body: "§pModel:§r §oTuktuk§r\n\n§pDescription:§r §oA hover Tuktuk with flight capabilities§r\n\n§cSpeed:         [][][][]§r[][][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][][]§r[][][][][][][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:hovers",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:hover_tuktuk"],
  },
  // HOVERS - TUK-VAN
  {
    menuID: "pb_plane:tukvan",
    title: "§0Hover Tuk-Van",
    body: "§pModel:§r §oTuk-Van§r\n\n§pDescription:§r §oA van-type of Tuktuk with flight capabilities§r\n\n§cSpeed:         [][][][]§r[][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][][][]§r[][][][][][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:hovers",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:hover_tukvan"],
  },
  // HOVERS - BIKE
  {
    menuID: "pb_plane:bike",
    title: "§0Hover Bike",
    body: "§pModel:§r §oHover Bike§r\n\n§pDescription:§r §oA motor cycle with flight§r\n\n§cSpeed:         [][][][][]§r[][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:hovers",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:hover_bike"],
  },
  // HOVERS - VESPA
  {
    menuID: "pb_plane:vespa",
    title: "§0Hover Vespa",
    body: "§pModel:§r §oHover Vespa§r\n\n§pDescription:§r §oA vespa styled motor cycle with flight§r\n\n§cSpeed:         [][][][][]§r[][][][][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:hovers",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:hover_vespa"],
  },
  //// CONTENT SECTION - UFO
  {
    menuID: "pb_plane:ufos",
    title: "§0UFOs",
    body: "§7Select a UFO",
    buttons: [
      {
        title: "§0UFO",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_ufos/ufo",
        connectID: "pb_plane:ufo",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // UFOS - UFO
  {
    menuID: "pb_plane:ufo",
    title: "§0UFO",
    body: "§pModel:§r §oUFO§r\n\n§pDescription:§r §o\nAn Unknown Flying Object§r\n\n§cSpeed:         [][][][]§r[][][][][][]\n§9Passengers:  []§r[][][][][][][][][]\n§6Storage:       [][]§r[][][][][][][][]\n\n§3Color Layers: §r1\n\n\n§l§b(§e-§b)§r§7This §rUFO§7 can lift and transport §bmobs, items and item crates§7.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:ufos",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:ufo"],
  },
  //// CONTENT SECTION - CARS
  {
    menuID: "pb_plane:cars",
    title: "§0Cars",
    body: "§7Select a Vehicle",
    buttons: [
      {
        title: "§0Sports Car",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_cars/sports",
        connectID: "pb_plane:sports",
      },
      {
        title: "§0Police Car",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_cars/police",
        connectID: "pb_plane:police",
      },
      {
        title: "§0Fire Truck",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_cars/fire_truck",
        connectID: "pb_plane:fire_truck",
      },
      {
        title: "§0Large Fire Truck",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_cars/fire_truck_large",
        connectID: "pb_plane:fire_truck_large",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // CARS - SPORTS
  {
    menuID: "pb_plane:sports",
    title: "§0Sports Car",
    body: "§pModel:§r §oSports Car§r\n\n§pDescription:§r §o\nBasic Car§r\n\n§cSpeed:         [][][][][][][][]§r[][]\n§9Passengers:  [][]§r[][][][][][][][]\n§6Storage:       [][][][][][]§r[][][][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:cars",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:car_sports"],
  },
  // CARS - POLICE
  {
    menuID: "pb_plane:police",
    title: "§0Police Car",
    body: "§pModel:§r §oPolice Car§r\n\n§pDescription:§r §o\nBasic Car§r\n\n§cSpeed:         [][][][][][][]§r[][][]\n§9Passengers:  [][][][]§r[][][][][][]\n§6Storage:       [][][][][][][][]§r[][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:cars",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:car_police"],
  },
  // CARS - FIRE TRUCK
  {
    menuID: "pb_plane:fire_truck",
    title: "§0Fire Truck",
    body: "§pModel:§r §oFire Truck§r\n\n§pDescription:§r §o\nBasic Truck§r\n\n§cSpeed:         [][][][][]§r[][][][][]\n§9Passengers:  [][][][]§r[][][][][][]\n§6Storage:       [][][][][][][][]§r[][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:cars",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:car_fire"],
  },
  // CARS - FIRE TRUCK LARGE
  {
    menuID: "pb_plane:fire_truck_large",
    title: "§0Large Fire Truck",
    body: "§pModel:§r §oLarge Fire Truck§r\n\n§pDescription:§r §o\nLarge Truck§r\n\n§cSpeed:         [][][]§r[][][][][][][]\n§9Passengers:  [][][][]§r[][][][][][]\n§6Storage:       [][][][][][][][][][]§r\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:cars",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:car_fire_large"],
  },
  //// CONTENT SECTION - BOATS
  {
    menuID: "pb_plane:boats",
    title: "§0Boats",
    body: "§7Select a Boat",
    buttons: [
      {
        title: "§0Speed Boat",
        icon: "textures/PixelBiester/Airplane/form_icons/guide_boats/speed",
        connectID: "pb_plane:speed",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // BOATS - SPEED
  {
    menuID: "pb_plane:speed",
    title: "§0Speed Boat",
    body: "§pModel:§r §oSpeed Boat§r\n\n§pDescription:§r §o\nBasic Boat§r\n\n§cSpeed:         [][][][][][][]§r[][][]\n§9Passengers:  [][][][][][][][]§r[][]\n§6Storage:       [][][][][][][][]§r[][]\n\n§3Color Layers: §r1",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:boats",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:speed_boat"],
  },
  //// CONTENT SECTION - PARACHUTE
  {
    menuID: "pb_plane:parachute",
    title: "§0Parachute",
    body: "§7The §bParachute§7 can be equipped in the §rchestplate slot§7, when in the air and §rsneaking§7, your parachute will deploy, allowing you to fall safely.\n\nYou can also dye your parachute in a cauldron with water and dye, just like leather armor!",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },
  // CONTENT SECTION - TRANSPORT CRATES
  {
    menuID: "pb_plane:crates",
    title: "§0Transport Crates",
    body: "§bCargo Crates§7 & §bItem Crates§7 can be used to transport §rmobs§7 or §ritems§7 directly via flying vehicles.\n\nTo pick up a crate, hover over it with the correct vehicle until a §rpopup§7 appears. It will then be attached with a line.\n\n§l§b(§e-§b)§r§7 Press §rInteract§7 while flying to release the attached crate.\n\n§l§b(§e-§b)§r§7 Pick up §bItem Crates§7 with a §rPassenger Drone or UFO§7.\n\n§l§b(§e-§b)§r§7Access the §bItem Crates§7' inventory by interacting with it.\n\n§l§b(§e-§b)§r§7 Pick up §rCargo Crates§7 with a §rCargo Helicopter§7.\n\n§l§b(§e-§b)§r§7To capture a §bmob§7, place down a §rCargo Crate§7 and find a way to lure the mob close to it. §rPlease note§7, that not all mobs are able to ride in the Cargo Crate.\n\n§l§b(§e-§b)§r§7 Destroy crates by §rhitting§7 repeatedly.",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:content",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: ["pb_plane:cargo_crate", "pb_plane:item_crate"],
  },

  // ABOUT SECTION

  {
    menuID: "pb_plane:about",
    title: "§0About this Add-On",
    body: "Version: §a1.1.0§r\n\n§2Airplanes Add-On!§r created by Pixelbiester.§r\n\nFollow us:\n§3Twitter§r §o@Pixelbiester\n§r§dInstagram§r §o@pixelbiesterofficial§r\n§cYoutube§r §oPixelBiester§r\n§eWebsite§r §opixelbiester.net§r\n§sDiscord§r §opixelbiester.net/discord§r\n\n",
    buttons: [
      {
        title: "§0Version 1.1",
        icon: "textures/PixelBiester/Airplane/form_icons/update_1",
        connectID: "pb_plane:update_1",
      },
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:main",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },

  // UPDATE 1.1 CHANGELOG

  {
    menuID: "pb_plane:update_1",
    title: "§01.1 Changelog",
    body: "Version: §a1.1.0§r §bHover Update§r\n\n§7- Added §b9 new§7 flying and hovering vehicles with §bfull customization§7\n\n- Added a workable §btractor beam§7 to the new UFO\n\n- Added new '§bSewing Machine§7' to make balloon cloth",
    buttons: [
      {
        title: "§0Return",
        icon: "textures/PixelBiester/Airplane/form_icons/return_icon",
        connectID: "pb_plane:main",
      },
    ],
    type: "form",
    openOnBlock: [],
    openOnEntity: [],
  },

  // CONFIG SECTION

  {
    menuID: "pb_plane:config",
    type: "function",
    openOnBlock: [],
    openOnEntity: [],
  },
];

//FUNCTIONAL MENUS
function configMenu(player) {
  let form = new ui.ModalFormData();
  form.title("Config");
  form.slider("A Slider", 50, 100, 1, 100);
  form.slider("Another Slider", 0, 100, 1, 0);
  form.submitButton("Return");

  form.show(player).then((result) => {
    if (result.canceled) return;
  });
}

guidebookModule();
interactionModule();

function openMenu(player, menuID) {
  player.playSound(SOUND_TURN_PAGE, SOUND_OPTIONS);

  const menu_data = MENUS.find((f) => f.menuID == menuID);
  if (menu_data == undefined) return;
  //exceptions for functional menus
  if (menu_data.type == "function") {
    if (menu_data.menuID == "pb_plane:config") configMenu(player); //register your functional menus here
    return;
  }
  //construct menu from array
  const menu = new ui.ActionFormData();
  menu.title(menu_data.title);
  menu.body(menu_data.body);
  menu_data.buttons.forEach((button) => {
    menu.button(button.title, button.icon);
  });

  menu.show(player).then((result) => {
    if (result.canceled) return;

    let response = result.selection;
    openMenu(player, menu_data.buttons[response].connectID);
  });
}

//basic guidebook dropping and opening functionality
function guidebookModule() {
  //drop guidebook on player first spawn only
  mc.world.afterEvents.playerSpawn.subscribe((eventData) => {
    if (eventData.player.hasTag(GUIDEBOOK_TAG)) {
    } else {
      mc.world
        .getDimension(eventData.player.dimension.id)
        .spawnItem(
          new mc.ItemStack(GUIDEBOOK_ITEM, 1),
          eventData.player.location
        );
      eventData.player.addTag(GUIDEBOOK_TAG);
    }
  });

  //guidebook entity check
  mc.world.beforeEvents.playerInteractWithEntity.subscribe((eventData) => {
    const player = eventData.player;
    const item = eventData.itemStack;
    const entity = eventData.target;
    if (item == undefined) return;
    if (item.type.id != GUIDEBOOK_ITEM) return;

    let menu;
    MENUS.forEach((menudata) => {
      if (menudata.openOnEntity.includes(entity.typeId)) menu = menudata;
    });

    if (menu == undefined) return;
    eventData.cancel = true;
    mc.system.runTimeout(() => {
      openMenu(player, menu.menuID);
    }, 0);
  });
}

//activate this for block and entity interactions checks
function interactionModule() {
  //guidebook block check
  mc.world.beforeEvents.playerInteractWithBlock.subscribe((eventData) => {
    const player = eventData.player;
    const item = eventData.itemStack;
    const block = eventData.block;
    if (item == undefined) return;
    if (item.type.id != GUIDEBOOK_ITEM) return;

    let menu;
    MENUS.forEach((menudata) => {
      if (menudata.openOnBlock.includes(block.typeId)) menu = menudata;
    });

    if (menu == undefined) return;
    eventData.cancel = true;
    mc.system.runTimeout(() => {
      openMenu(player, menu.menuID);
    }, 0);
  });

  //guidebook activation listener
  mc.world.afterEvents.itemUse.subscribe((eventData) => {
    let player = eventData.source;
    let itemUse = eventData.itemStack;
    if (itemUse === undefined) return;
    if (itemUse.typeId == GUIDEBOOK_ITEM)
      mc.system.runTimeout(() => {
        openMenu(player, "pb_plane:main");
      }, 1);
  });
}
