ItemEvents.tooltip(event => {

  // Tooltips for custom modpack items
  // Formatting rules: 
  // - Keys: §d (pink)
  // - Mechanics: §b (cyan, italic for emphasis if needed)
  // - Items: §f (white, italic for emphasis)
  // - General text: gray

  // Tooltips for custom modpack items
  // Formatting rules: 
  // - Keys: §d (pink)
  // - Mechanics: §b (cyan, italic for emphasis if needed)
  // - Items: §f (white, italic for emphasis)
  // - General text: gray

  // ====================

  // Sword
  event.addAdvanced(['minecraft:wooden_sword', 'minecraft:stone_sword', 'minecraft:golden_sword',  'minecraft:iron_sword', 'minecraft:diamond_sword', 'minecraft:netherite_sword'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Hold §d[RIGHT CLICK]§r to block 50% of incoming damage! \n\nBlock just before an attack lands to §b§oparry§r it away!\n\nNot as good at parrying as a §f§oshield§r would be, but better than nothing!\n'))
    }
  })

  // Shovel
  event.addAdvanced(['minecraft:wooden_shovel', 'minecraft:stone_shovel', 'minecraft:golden_shovel', 'minecraft:iron_shovel', 'minecraft:diamond_shovel', 'minecraft:netherite_shovel'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§bShoves§r enemies back! \n\nIf one enemy is §bshoved§r into another, \nit will create a §bchain-reaction§r.\n'))
    }
  })

  // Hoe & Knives
  event.addAdvanced(['minecraft:wooden_pickaxe', 'minecraft:stone_pickaxe', 'minecraft:golden_pickaxe', 'minecraft:iron_pickaxe', 'minecraft:diamond_pickaxe', 'minecraft:netherite_pickaxe'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Land a §bcritical strike§r on an enemy to begin an §bairstrike§r combo! \n\nThe more §bcritical hits§r you land §fsuccessively§r, the §fhigher§r you and the enemy will go!§r\n'))
    }
  })

  // Trident
  event.addAdvanced(['minecraft:trident', 'minecraft:fishing_rod', 'clash:rod_of_gales', 'minecraft:wooden_hoe', 'minecraft:stone_hoe', 'minecraft:golden_hoe', 'minecraft:iron_hoe', 'minecraft:diamond_hoe', 'minecraft:netherite_hoe'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Land a §bcritical strike§r on an enemy to begin an §bairdash§r combo! \n\nThe more §bcritical hits§r you land §fsuccessively§r, the §ffurther§r you and the enemy will go!§r\n'))
    }
  })

  // Wooden Bows
  event.addAdvanced(['minecraft:bow'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Weapon from ancient times cursed with a \n§bblinding glimmer§r and a terrible vulnerability\nto §fArrow damage§r when fired.\nTotal §bGarbage§r. Best used for spare §fSticks§r.'))
    }
  })

  // Bows
  event.addAdvanced(['archeryexp:wooden_bow', 'archeryexp:iron_bow', 'archeryexp:gold_bow', 'archeryexp:diamond_bow', 'archeryexp:netherite_bow'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Applies the §bQuickdraw§r effect briefly whilst charging, which makes you take §fmore damage from Arrows§r!\n\nTry shooting Skeletons directly after they\'ve fired both for the most safety, \nand for the best chance at making them take §bQuickdraw§r damage themselves!'))
    }
  })

  // Torch
  event.addAdvanced(['minecraft:torch'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Whilst you §ocan§r still use §fCoal§r to craft §fTorches§r,\nit\'ll cost a §fnatural fuel§r to do so too, like §fRotten Flesh§r!\nHowever, you could instead use §bSulphur§r,\nwhich §fbypasses§r the need for §fnatural fuels OR Coal.§r.'))
    }
  })

  // Stick
  event.addAdvanced(['minecraft:stick'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Can\'t be crafted from §fPlanks§r, but still drops from §fLeaves§r!\n\nCan be §bShaved§r off of §fLogs§r with an §fAxe§r in a §fCrafting Table§r\nat the cost of §bdurability damage§r.\n\nAlso craftable by destroying §fSaplings§r with §fFlint§r.'))
    }
  })

  // Flint
  event.addAdvanced(['minecraft:flint'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Used to make §fFlint Tools§r.\n\nCan be §bShattered§r off of §fCobblestone§r with a §fPickaxe§r in a §fCrafting Table§r\nat the cost of §bdurability damage§r.\n'))
    }
  })

  // String
  event.addAdvanced(['minecraft:string'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Used to §bbind§r numerous items together.\n\nCan be §bTorn§r from §fWool§r with a §fSword§r\nat the cost of §bdurability damage§r.\n\nAlso craftable by destroying §fWool§r or §fCobwebs§r with §fFlint§r.\n'))
    }
  })

  // Gunpowder/Sulphur
  event.addAdvanced(['minecraft:gunpowder'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Drops from slain §fCreepers§r.\n..It\'s just Gunpowder.'))
    }
  })

  // Coal Ore
  event.addAdvanced(['minecraft:coal_ore', 'minecraft:deepslate_coal_ore'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Drops §fCoal§r when mined, and rarely §fFlint§r too!\n'))
    }
  })

  // Gravel
  event.addAdvanced(['minecraft:gravel'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Drops §fFlint§r when mined, and rarely §fRaw Copper§r too!\n'))
    }
  })

  // Raw Copper
  event.addAdvanced(['minecraft:raw_copper'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Sometimes drops from §fZombies§r, in addition to §fGravel§r!\nUsed to make §fFurnaces§r.\n'))
    }
  })

  // Diamond
  event.addAdvanced(['minecraft:diamond'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§fDiamonds§r only generated §bexposed to air§r, so §bstripmining§r is a fruitless endeavour.\n'))
    }
  })

  // Harpoon 
  event.addAdvanced(['species:harpoon'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Only fires §bdirectly upwards.§r Once §battached to the ceiling§r, you can §bsway yourself around§r to move forward.Can be upgraded into the §fGrappling Hook.§r\n'))
    }
  })

  // Flint Knife
  event.addAdvanced(['farmersdelight:flint_knife'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§bCuts§r §fGrass§r into §fStraw§r, and yields extra drops from §fAnimals§r!\n'))
    }
  })

  // Campfire
  event.addAdvanced(['minecraft:campfire'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Needs to be lit with a §fFirestarter§r when placed.\n\nFlying over it with a §fWings§r when it\'s §bsignaling§r will §bjut you up§r into the air!\n'))
    }
  })

  // Amethyst Shard
  event.addAdvanced(['minecraft:amethyst_shard'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('The primary currency used by the §fOwlagers§r.\nDon\'t tell them it can be found for free underground...\n'))
    }
  })

  // Emerald
  event.addAdvanced(['minecraft:emerald'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('The primary currency used by the §fGem and Grimm Traders§r.\nGrab as many of these as you can!\n'))
    }
  })

  // Leather
  event.addAdvanced(['minecraft:leather'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Can be §bsmelted§r from §fRotten Flesh§r!\n'))
    }
  })
  
  // Rotten Flesh
  event.addAdvanced(['minecraft:rotten_flesh'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Can be §bsmelted§r into §fLeather§r!\n'))
    }
  })

  // Ash
  event.addAdvanced(['supplementaries:ash'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Can §bduplicate§r certain items, like §fSulphur§r and §fBonemeal§r. \n§fDrops§r from mobs that died whilst §6burning§r.\n'))
    }
  })

  // Lunch Box
  event.addAdvanced(['solapplepie:lunchbag', 'solapplepie:lunchbox','solapplepie:golden_lunchbox'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§d[SHIFT]§r + §d[RIGHT CLICK]§r to open. Can store multiple §fFood§r items inside!\n\n§fFood§r will be destroyed if §bupgraded§r. Empty beforehand!\n'))
    }
  })

  // Naga Tail
  event.addAdvanced('kubejs:naga_tail', (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Consuming a §fNaga Tail§r marks you with an §bodorous effect§r\nsignifying your slaying of a Naga, which signals your territorial stake wherever you go whilst the effect is active. That is to say... §aEat this, and Nagas won\'t spawn!§r'))
    }
  })

  // Vampear
  event.addAdvanced('kubejs:vampear', (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Consuming a §fVampear§r gives you the §bpower of a vampire,§r\nallowing you to temporarily increasing your §amaxmium health pool!§r'))
    }
  })

  // Echo Igniter
  event.addAdvanced('deepnether:deep_nether', (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §3[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§3Strike an §bAncient City Portal Frame §3with this dagger to open a portal to §bthe Nether.'))
    }
  })

  // Uninscribed Scroll
  event.addAdvanced('summonerscrolls:enhancement_scroll', (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Can either §bupgrade§r an existing §fSummoner Scroll§r into a stronger variant, or have a §fSummon§r §binscribed§r into it in a §fGem Forge§r.'))
    }
  })

  // Bridge Brace
  event.addAdvanced('betterbridging:bridge_brace', (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Hold the §fBrace§r in your off-hand, and any §fblocks§r you place will be placed in a §bformation of 3!§r Press §d[R]§r to §brotate§r the direction the blocks are placed in.'))
    }
  })

  // Sack
  event.addAdvanced('supplementaries:sack', (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Can hold multiple items at once, like a §fShulker Box!§r Carrying §btoo many§r at once \nwill §brweigh you down§r though...'))
    }
  })

  // Explorer Compass
  event.addAdvanced(['explorerscompass:explorerscompass'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Shows you the location of §bany structure!§r'))
    }
  })

  // Lantern
  event.addAdvanced(['minecraft:lantern', 'minecraft:soul_lantern'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Can be §bequipped to your hip§r so you §ehave light wherever you go!'))
    }
  })

  // Enchanting Table
  event.addAdvanced(['minecraft:enchanting_table'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§aEnchanting magic§r has grown unstable. It will §aleech§r experience out of you like how my §bex-wife§r §aleeched§r the §bmorgage payments§r for the §ahouse§r out of §ame!'))
    }
  })

  // Smithing Table
  event.addAdvanced(['minecraft:smithing_table'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Hammer §bEnchanting Gems§r into tools to §benchant them!§r \nThe more the same gem is applied, the §bmore levels§r of the enchantment is added.'))
    }
  })

  // Gem Forge
  event.addAdvanced(['miningmaster:gem_forge'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§bMelt down gems and metals§r onto existing items, called §fcatalysts§r, to create new enchanted items. \n§fWarning: Overrides any existing enchantments the catalyst currently holds.'))
    }
  })

  // Enchanting Gems
  event.addAdvanced(['miningmaster:mm_tab_icon'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§bEnchanting Gems§r are found in rare ores, boss mobs and §fMonster Boxes§r, \nand can be applied to tools in a §fSmithing Table§r to §benchant§r them, \nor to catalysts in a §fGem Forge§r to §bmelt them down§r into something entirely new.'))
    }
  })

  // Heart of Diamond
  event.addAdvanced(['quark:diamond_heart'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Can be used in a smithing table to §bUpgrade a material to the next level whilst keeping it\'s enchantments!§r'))
    }
  })

  // Warp Bank (Ender Chest)
  event.addAdvanced(['minecraft:ender_chest'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Only §fYOU§r can see the contents of your own personal §dWarp Bank!§r\nRequires §bSilk Touch§r to pick up.'))
    }
  })

  // Waystone
  event.addAdvanced(['waystones:waystone'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§d[RIGHT CLICK]§r to §bactivate§r, then again to §bteleport§r to any other active §fWaystones§r.'))
    }
  })

  // Warp Stone
  event.addAdvanced(['waystones:warp_stone'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§d[RIGHT CLICK]§r to §bteleport§r to any active §fWaystones§r. \nTakes a long time to cool-down after use.'))
    }
  })


  // Warp Dust
  event.addAdvanced(['waystones:warp_dust'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Useful in the crafting of §bteleportation§r §fScrolls§r.\nSometimes drops from slain §fEndermen§r.'))
    }
  })


  // Warp Scroll
  event.addAdvanced(['waystones:warp_scroll'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§d[RIGHT CLICK]§r to §bteleport§r to §fany§r active §fWaystones§r.Consumed after use.'))
    }
  })

  // Return Scroll
  event.addAdvanced(['waystones:return_scroll'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§d[RIGHT CLICK]§r to §bteleport§r to your §flast§r activated §fWaystone§r. Consumed after use.'))
    }
  })

  // Bound Scroll
  event.addAdvanced(['waystones:bound_scroll'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§bBind§r to a §fWaystone§r by §d[RIGHT CLICKING]§r whilst holding. When bound, §d[RIGHT CLICK]§r to §bteleport§r to your §fBound Waystone§r. Consumed after use.'))
    }
  })

  // Combustion Table
  event.addAdvanced(['galosphere:combustion_table'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Upgrade §fSilver Bombs§r into §bbouncier§r and §blonger-fusing§r variants!'))
    }
  })

  // Silver Helmet
  event.addAdvanced(['galosphere:sterling_helmet'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Equip a §fBanner§r by §d[RIGHT CLICKING]§r the helmet with one.'))
    }
  })

  // Golden Helmet
  event.addAdvanced(['minecraft:golden_helmet', 'minecraft:golden_chestplate', 'minecraft:golden_leggings', 'minecraft:golden_boots', ], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('Increases your §bmovement speed§r by 6% when worn!'))
    }
  })

  // Ruined Equipment
  event.addAdvanced(['ruined_equipment:ruined_diamond_helmet'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§bRepair§r in an §fAnvil§r to bring it back to life!'))
    }
  })

  // Ruined Item Ashes
  event.addAdvanced(['ruined_equipment:ruined_item_ashes'], (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §d[SHIFT]§r for more information'))
    } else {
      text.add(1, Text.gray('§bRepair§r in an §fAnvil§r with §bDiamonds§r to bring it back to life!'))
    }
  })

  // Bed
  event.addAdvanced([
  "minecraft:white_bed",
  "minecraft:orange_bed",
  "minecraft:magenta_bed",
  "minecraft:light_blue_bed",
  "minecraft:yellow_bed",
  "minecraft:lime_bed",
  "minecraft:pink_bed",
  "minecraft:gray_bed",
  "minecraft:light_gray_bed",
  "minecraft:cyan_bed",
  "minecraft:purple_bed",
  "minecraft:blue_bed",
  "minecraft:brown_bed",
  "minecraft:green_bed",
  "minecraft:red_bed",
  "minecraft:black_bed"
  ], 
  (item, advanced, text) => {
    if (!event.shift) {
      text.add(1, Text.gray('Hold §dSHIFT§r for more information'))
    } else {
      text.add(1, Text.gray('Cannot be picked up without §bSilk Touch.§r'))
    }
  })

})

//

// §nMinecraft Formatting§r
//
// §00 §11 §22 §33
// §44 §55 §66 §77
// §88 §99 §aa §bb
// §cc §dd §ee §ff
//
// §rk §kMinecraft
// §rl §lMinecraft
// §rm §mMinecraft
// §rn §nMinecraft
// §ro §oMinecraft
// §rr §rMinecraft