function init(hero) {
    hero.setName("Mining Armor");
    hero.setVersion("Shue Tech");
    hero.setAliases("ma");
    hero.setTier(7);

    hero.addPowers("secretheroes:eternium_redstone_powered_dwarf_star_armor");

    hero.setHelmet("item.superhero_armor.piece.helmet");
    hero.setChestplate("item.superhero_armor.piece.chestplate");
    hero.setLeggings("item.superhero_armor.piece.leggings");
    hero.setBoots("item.superhero_armor.piece.boots");
    hero.setPrimaryEquipment("fiskheroes:tutridium_pickaxe");

    hero.addAttribute("MAX_HEALTH", -0.5, 1);
    hero.addAttribute("PUNCH_DAMAGE", 0.5, 0);
    hero.addAttribute("WEAPON_DAMAGE", -5.0, 0);
    hero.addAttribute("BASE_SPEED_LEVELS", 2.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.5, 1);
    hero.addAttribute("FALL_RESISTANCE", 1.0, 1);
    hero.addAttribute("REACH_DISTANCE", 5.0, 0);

    hero.addKeyBind("SUPER_SPEED", "key.superSpeed", 1);
    hero.addKeyBind("INTANGIBILITY", "key.intangibility", 2);
    hero.addKeyBind("HOVER", "key.hover", 3);
    hero.addKeyBind("SIZE_MANIPULATION", "key.sizeManipulation", 4);
    hero.addKeyBind("CHARGED_BEAM", "Eternium Laser", 5);
    hero.addKeyBind("GROUND_SMASH", "Mineral Blast \u00A7o(use on self)", 5);

    hero.addSoundEvent("STEP", "secretheroes:mining_armor_step");

    hero.setHasProperty(hasProperty);
    hero.setModifierEnabled(isModifierEnabled);
    hero.addAttributeProfile("SMALL", smallProfile);
    hero.setAttributeProfile(getAttributeProfile);

    hero.setKeyBindEnabled(isKeyBindEnabled);
}

function hasProperty(entity, property) {
    return property == "BREATHE_SPACE";
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:flight":
        return !entity.getData("fiskheroes:jetpacking") && !entity.getData("fiskheroes:hovering");
    case "fiskheroes:ground_smash":
        return !entity.hasPotionEffect(3);
    default:
        return true;
    }
}

function smallProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("BASE_SPEED_LEVELS", 6.0, 0);
}

function getAttributeProfile(entity) {
    if (entity.getData('fiskheroes:scale') <= 0.05001) {
        return "SMALL";

    }
    return null;
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "CHARGED_BEAM":
        return entity.isSneaking();
    case "GROUND_SMASH":
        return !entity.isSneaking() && entity.getHeldItem().isEmpty();
    default:
        return true;
    }
}
