onEvent('item.tooltip', tooltip => {
    //compressium
    for (let i = 1; i <= 9; i++) {
        tooltip.add(
            RegExp(`compressium.*_${i}`),
            Text.gray(
                `Contains ${Math.pow(9, i)
                    .toString()
                    .replace(/\B(?=(\d{3})+(?!\d))/g, ',')} blocks`
            )
        )
    }

    //tconstruct
    tooltip.add('tconstruct:part_builder', 'Can be made out of any planks')
    tooltip.add('tconstruct:tinker_station', 'Can be made out of any planks')
    tooltip.add('tconstruct:crafting_station', 'Can be made out of any log')
    tooltip.add(['tconstruct:tinkers_anvil','tconstruct:scorched_anvil'], 'Can be made out of any alloy block')
    tooltip.add(/minecraft:(leather|chainmail|wooden|stone|iron|golden|diamond|netherite)_(sword|shovel|(pick)?axe|hoe|helmet|chestplate|leggings|boots)/, [
        Text.red("1 Durability. This item is for crafting only!"),
    ]);
    tooltip.add(/minecraft:(bow|crossbow)/, [
        Text.red("1 Durability. This item is for crafting only!"),
    ]);

    //ceramics
    tooltip.add('ceramics:clay_plate',['Can be used to create Small Plate Casts'])
    tooltip.add('ceramics:unfired_clay_plate',['Can be used to create Small Plate Casts after fired in a furnace'])

    //miniutilities
    tooltip.add('miniutilities:unstable_ingot',[ Text.green('This WILL kill you, blow up, and lose all your crafting materials to make this if you hold this too long') ])
	
	//mechanisms
	let main_assembly = (id, stage) => tooltip.add(id, [`§7Main Assembly: §6Chapter ${stage}`, '§8Consider automating this item'])
	main_assembly('kubejs:kinetic_mechanism', "2")
	main_assembly('kubejs:sealed_mechanism', "3")
	main_assembly('create:precision_mechanism', "4")
	main_assembly('kubejs:inductive_mechanism', "5")
	main_assembly('kubejs:calculation_mechanism', "6")
	main_assembly('kubejs:abstruse_mechanism', "7")
	
	//ae2
    tooltip.add('appliedenergistics2:facade', 'Using the same recipe, you can make a facade out of almost any block')

    //end portal frame
    tooltip.add('minecraft:end_portal_frame', '§7Requires §6Silk Touch §7to break.')

    //framed compact drawers
    tooltip.add(/framedcompactdrawers.*/, `§eCan be framed through crafting table`)

    //cobblefordays
    //ticks are stored in defaultconfigs/cobblefordays-server.toml
    const ticks = {
        tier1: 200,
        tier2: 100,
        tier3: 50,
        tier4: 25,
        tier5: 10
    }
    const items = [
        "cobblefordays:tier_1", "cobblefordays:tier_2", "cobblefordays:tier_3", "cobblefordays:tier_4", "cobblefordays:tier_5"
    ]
    items.forEach((item, i) => {
        const tick = ticks[`tier${i + 1}`]
        tooltip.add(item, `§7Generates 1 cobblestone per §6${tick / 20} §7second(s)`)
    })

    //power pots
    const pots = [
        { energy: 500, output: 16 },
        { energy: 1000, output: 32 },
        { energy: 1500, output: 48 },
        { energy: 2000, output: 64 },
    ]
    pots.forEach((pot, i) => {
        tooltip.add(`ftb-power-pots:power_pot_mk${i + 1}`, `§7Energy Per Tick: §6${pot.energy}`)
        tooltip.add(`ftb-power-pots:power_pot_mk${i + 1}`, `§7Items Per Output: §6${pot.output}`)
    })



    /*tier tooltips
    §1 - dark blue
    §2 - dark green
    §3 - dark aqua
    §4 - dark red
    §5 - purple
    §6 - orange
    §8 - dark gray
    §9 - blue
    §0 - black
    §a - light green
    §b - light aqua
    §c - light red
    §d - pink
    §e - light yellow
    §f - white*/
    const tiers = [
        {
            tier: "§7Poor",
            items: [
                /minecraft:(wooden|stone|iron|golden|diamond|netherite)_(sword|shovel|(pick)?axe|hoe|shears)/,
                /minecraft:(leather|chainmail|iron|gold|diamond|netherite)_(helmet|chestplate|leggings|boots)/,
                // /ceramics:clay_(helmet|chestplate|leggings|boots)/,
                // /tconstruct:\b.*_(helmet|chestplate|leggings|boots)/,
                /tconstruct:(pickaxe|sledge_hammer|vein_hammer|mattock|excavator|hand_axe|broad_axe|kama|scythe|dagger|sword|cleaver)\b/,
                /constructsarmory:material_armor_(helmet|chestplate|leggings|boots)/,
                /minecraft:(bow|crossbow|shears|trident)/,
                /sophisticatedbackpacks:\b.*backpack/,
                /ironfurnaces:(iron|copper|gold|diamond|emerald|netherite|crystal|obsidian|copper|silver)_furnace/,
                "ironfurnaces:item_spooky",
                /tinkersarchery:(shortbow|longbow|crossbow)/,
                /shieldexp:\b.*_shield/,
            ],
        },
        {
            tier: "§fCommon",
            items: [
                "avaritia:skullfire_sword",
                /miniutilities:\b.*_(sword|shovel|(pick)?axe|hoe|shears)/,
                /miniutilities:unstable_(helmet|chestplate|leggings|boots)/,
            ],
        },
        {
            tier: "§aUncommon",
            items: [
                /wstweaks:\b.*_blade/,
            ],
        },
        {
            tier: "§9Rare",
            items: [
                "miniutilities:kikoku",
                /projecte:dm_(sword|shovel|pick|axe|hoe|shears|hammer|helmet|chestplate|leggings|boots|furnace)/,
                /projectextended:dark_matter_.*/,
            ],
        },
        {
            tier: "§5Epic",
            items: [
                /projecte:rm_(sword|shovel|pick|axe|hoe|shears|hammer|katar|morning_star|helmet|chestplate|leggings|boots|furnace)/,
                /projectextended:red_matter_.*/,
                /projecte:gem_(helmet|chestplate|leggings|boots)/,
                /miniutilities:infused_(helmet|chestplate|leggings|boots)/,
                "mekanism:electric_bow",
                /mekanism:(hazmat|mekasuit)_(mask|gown|helmet|bodyarmor|pants|boots)/,
                /boss_tools:(netherite_)?(oxygen_mask|space_suit|space_pants|space_boots)/,
            ],
        },
        {
            tier: "§EArtifact",
            items: [
                /avaritia:(swordofthe_cosmos|hoeofthe_green_earth|natures_ruin|longbowofthe_heavens|planet_eater|world_breaker|infinity_armor_.*)/,
                "ironfurnaces:million_furnace",
            ],
        },
    ]
    tiers.forEach(obj => {
        tooltip.add(obj.items, `§7Tier: ${obj.tier}`)
    })
})