 function init(hero) {
    hero.setName("Captain America/\u00A7d\u00A7lKNIGHTS\u00A7r");
    hero.setTier(5);
    
    hero.setHelmet("Helmet");
    hero.setChestplate("Chestplate");
    hero.setLeggings("Leggings");
    hero.setBoots("Boots");
    hero.addPrimaryEquipment("fiskheroes:captain_americas_shield", true);
    hero.addPrimaryEquipment("fiskheroes:desert_eagle", true, item => !item.nbt().getBoolean("Dual"));
    
    hero.addPowers("knights:super_serum");
    hero.addAttribute("PUNCH_DAMAGE", 5, 0);
    hero.addAttribute("WEAPON_DAMAGE", 3.5, 0);
    hero.addAttribute("FALL_RESISTANCE", 50, 0);
    hero.addAttribute("JUMP_HEIGHT", 2.5, 0);
    hero.addAttribute("BASE_SPEED", 0.9, 1);
    hero.addAttribute("BASE_SPEED_LEVELS", 1, 0);

    hero.addKeyBind("AIM", "key.aim", -1);
    hero.addKeyBind("GUN_RELOAD", "key.reload", 1);
    hero.addKeyBind("SLOW_MOTION", "Hightened Reflexes", 4);
    hero.addKeyBind("GROUND_SMASH", "Ground Pound", 3);
    hero.addKeyBind("SUPER_SPEED", "Super Soldier Booster", 5);
    hero.addKeyBind("SHIELD_THROW", "key.shieldThrow", 2);

    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setHasPermission(hasPermission);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setHasPermission((entity, permission) => permission == "USE_GUN");
    hero.supplyFunction("canAim", entity => entity.getHeldItem().isGun());
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "GUN_RELOAD":
        return entity.getHeldItem().isGun() && !entity.getData("fiskheroes:aiming");
    case "UTILITY_BELT":
        return !entity.getHeldItem().isGun();
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    return keyBind != "SHIELD_THROW" || entity.getHeldItem().name() == "fiskheroes:captain_americas_shield";
}

function hasPermission(entity, permission) {
    return permission == "USE_SHIELD";
}
