ServerEvents.recipes(event => {
    event.shaped(
        Item.of('arrzenhanced:tachyon_battery'),
        [
            'ABA',
            'BDB',
            'ACA'
        ],
        {
            A: '#forge:ingots/iron',
            B: '#forge:ingots/copper',
            C: 'palladium:quartz_circuit',
            D: 'palladium:redstone_flux_crystal'
        }
    )
})

EntityEvents.hurt(event => {
    var { entity, source } = event
    if (entity.type == "minecraft:item") {
        event.server.runCommandSilent('say HEEEEEELP')
        if (source.type().msgId() == 'lightningBolt') { // struck by lightning
            if (entity.mainHandItem.id == "arrzenhanced:tachyon_battery") {
                entity.mainHandItem = Item.of('arrzenhanced:charged_tachyon_battery')
            }
            if (entity.offHandItem.id == "arrzenhanced:tachyon_battery") {
                entity.offHandItem = Item.of('arrzenhanced:charged_tachyon_battery')
            }
        }
    }
})