public static void addAbilities(LivingEntity entity, SpawnReason spawnReason)
	{
		// Fetch the mob config for this entity
		MobAbilityConfig ma, rateMa;
		rateMa = ma = AbilityConfig.i().getMobConfig(entity.getWorld().getName(), ExtendedEntityType.valueOf(entity), spawnReason);
		
		// If there is not config for the entity there is nothing more to do
		if (ma == null)
			return;
		
		// Fetch Ability Sets
		ValueChance<Ability> abilityChance = ma.attributes.get(AbilityType.ABILITY_SET);
		AbilitySet abilitySet = null;
		if (abilityChance != null)
		{
			// Fetch an ability
			abilitySet = (AbilitySet) abilityChance.getBonus();
			
			// If it is the 'none' ability we ignore it
			if (abilitySet != null && abilitySet.getAbilityConfig() == null)
			{
				abilitySet = null;
			}
		}
		
		boolean applyNormalAbilities = true;
		
		// If there is no ability or the 'none' ability set is given
		// we allow other abilities to be applied
		if (abilitySet != null)
		{
			// Only apply normal abilities if the ability set allows it
			applyNormalAbilities = abilitySet.applyNormalAbilities();
			
			// Make sure rates which are applied are the AbilitySets ones
			rateMa = abilitySet.getAbilityConfig();
		}
		
		// Apply rates to the mob
		rateMa.applyRates(entity);
		
		if (applyNormalAbilities)
		{
			applyNormalAbilities(entity, ma);
		}
		
		if (abilitySet != null)
		{
			// Add the ability and return to prevent other abilities being applied
			abilitySet.addAbility(entity);
		}
	}