Alcohol is only sold to people over 18, and sadly after 21:00 it cannot be bought in stores. The bars of the city stay open long enough so this isn't an issue. When inebriated on the streets late at night, do remember to stay respectful to the city you are a guest in.
Cigarettes can't be sold to people under 18. Slovenia has also banned smoking from public indoor spaces except in special smoking areas in offices, hotels and bars. Don't leave your butts on the floor either, there are plenty of bins around for them.