function init(hero) {

    hero.setName("Green Goblin");

    hero.setVersion("\u00A7c\u00A7lRaimi\u00A7r");

    hero.setTier(7);

    

    hero.setHelmet("Helmet");

    hero.setChestplate("Chestplate");

    hero.setLeggings("Pants");

    hero.setBoots("Boots");

    

    hero.addPowers("ahhp:goblin_formula", "ahhp:goblin_blades");

    hero.addAttribute("FALL_RESISTANCE", 10.0, 0);

    hero.addAttribute("JUMP_HEIGHT", 2.0, 0);

    hero.addAttribute("PUNCH_DAMAGE", 8.0, 0);

    hero.addAttribute("SPRINT_SPEED", 0.30, 1);

    hero.addAttribute("STEP_HEIGHT", 0.5, 0);

    hero.addAttribute("IMPACT_DAMAGE", 0.35, 1);

    hero.addAttribute("BASE_SPEED_LEVELS", 2.0, 0);



    hero.addKeyBind("SLOW_MOTION", "Enhanced Senses", 2);

    hero.addKeyBind("GOBLIN_BLADE", "Blades", 3);

    hero.addKeyBind("PUMPKIN_BOMB", "Pumpkin Bomb", 4);

    hero.addKeyBind("CHARGED_BEAM", "Glider Miniguns", 5);



    hero.setModifierEnabled(isModifierEnabled);

    hero.addAttributeProfile("GLIDER", gliderProfile);

    hero.addAttributeProfile("GOBLINBLADE", goblinbladeProfile);

    hero.setAttributeProfile(getAttributeProfile);

    hero.setKeyBindEnabled(isKeyBindEnabled);

    hero.setHasProperty(hasProperty);

    hero.setTickHandler((entity, manager) => {

        if (entity.motionY() < -0.6 && !entity.isSneaking() && !entity.isOnGround() && !entity.world().blockAt(entity.pos().add(0, -3, 0)).isSolid()) {

            manager.setData(entity, "fiskheroes:flying", true);

        };
    });

    hero.addSoundEvent("MASK_OPEN", "ahhp:green_goblin_laugh");

}



function hasProperty(entity, property) {

    return property == "MASK_TOGGLE";

}



function gliderProfile(profile) {

    profile.inheritDefaults();

    profile.addAttribute("IMPACT_DAMAGE", 0.5, 1);

}



function goblinbladeProfile(profile) {

    profile.inheritDefaults();

    profile.addAttribute("PUNCH_DAMAGE", 9.0, 0);

}



function getAttributeProfile(entity) {
    
    if (entity.getData("fiskheroes:flight_boost_timer") == 1) {

        return "GLIDER";

    }

    if (entity.getData("ahhp:dyn/goblinblade")) {

        return "GOBLINBLADE";

    }

    return null;

}



function isModifierEnabled(entity, modifier) {

    switch (modifier.name()) {

    case "fiskheroes:charged_beam":

        return entity.getData("fiskheroes:flight_timer") == 1;

    case "fiskheroes:lightning_cast":

        return entity.getData("ahhp:dyn/pumpkinbomb") && entity.getData("fiskheroes:flight_timer") == 0;

    case "ahhp:dyn/pumpkinbomb":

        return entity.getData("fiskheroes:flight_timer") == 0 && !entity.getData("ahhp:dyn/goblinblade");

    case "ahhp:dyn/goblinblade":

        return entity.getData("fiskheroes:flight_timer") == 0 && !entity.getData("ahhp:dyn/pumpkinbomb");

    default:

        return true;

    }

}



function isKeyBindEnabled(entity, keyBind) {

    switch (keyBind) {

        case "PUMPKIN_BOMB":

            return entity.getData("fiskheroes:flight_timer") == 0 && !entity.getData("ahhp:dyn/goblinblade");

        case "GOBLIN_BLADE":

            return entity.getData("fiskheroes:flight_timer") == 0 && !entity.getData("ahhp:dyn/pumpkinbomb");

        case "CHARGED_BEAM":

            return entity.getData("fiskheroes:flight_timer") == 1;

        default:

            return true;

    }

}