import requests


def get_mc_uuid(username):
    """Gets the Minecraft UUID for a username"""
    url = f"https://api.mojang.com/users/profiles/minecraft/{username}"
    res = requests.get(url)
    if res.status_code == 204:
        raise ValueError("Users must have a valid MC username")
    else:
        return res.json().get("id")