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|appliedenergistics2|boss_tools):(wooden|stone|iron|golden|diamond|netherite|certus_quartz|nether_quartz|steel)_(sword|shovel|(pick)?axe|hoe)/, [
        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.')

    //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)`)
    })



    /*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|appliedenergistics2|boss_tools):(wooden|stone|iron|golden|diamond|netherite|certus_quartz|nether_quartz|steel)_(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/,
                /minecraft:(bow|shears|trident|shield)/,
                /sophisticatedbackpacks:\b.*backpack/,
            ],
        },
        {
            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)/,
                /projectextended:dark_matter_.*/,
            ],
        },
        {
            tier: "§5Epic",
            items: [
                /projecte:rm_(sword|shovel|pick|axe|hoe|shears|hammer|katar|morning_star|helmet|chestplate|leggings|boots)/,
                /projectextended:red_matter_.*/,
                /projecte:gem_(helmet|chestplate|leggings|boots)/,
                /miniutilities:infused_(helmet|chestplate|leggings|boots)/,
                "mekanism:electric_bow",
            ],
        },
        {
            tier: "§EArtifact",
            items: [
                /avaritia:(swordofthe_cosmos|hoeofthe_green_earth|natures_ruin|longbowofthe_heavens|planet_eater|world_breaker|infinity_armor_.*)/,
            ],
        },
    ]
    tiers.forEach(obj => {
        tooltip.add(obj.items, `§7Tier: ${obj.tier}`)
    })
})