Async MC Launcher Core 🚀
A modern async Python library for custom Minecraft launchers
This project is a fork of JakobDev/minecraft-launcher-lib.
A Python library for building custom Minecraft launchers. Supports installing, launching Minecraft, and interacting with Mojang/Microsoft accounts.
Features
- Easy installation
- Generate Minecraft launch commands
- Microsoft account login support
- Supports Forge, Fabric, Quilt, and Liteloader
- Supports alpha/beta and legacy versions
- All functions are type-annotated and documented
- PyPy support
- Full online documentation and tutorials
- Vanilla launcher profiles read/write support
- mrpack modpacks support
- All public APIs are statically typed
- Rich examples
- Open source
Installation
Install via pip:
pip install async-mc-launcher-core
Or with uv (faster install):
uv pip install async-mc-launcher-core
Microsoft Account Login Example
import logging
from launcher_core import microsoft_account
import asyncio
from launcher_core.setting import setup_logger
from launcher_core.mojang import have_minecraft
logger = setup_logger(enable_console=False, level=logging.INFO, filename="microsoft_account.log")
async def login_microsoft_account():
AZURE_APP = microsoft_account.AzureApplication()
Login = microsoft_account.Login(azure_app=AZURE_APP)
login_url = await Login.get_login_url()
print(f"Please open {login_url} in your browser and copy the URL you are redirected into the prompt below.")
code_url = input()
code = await microsoft_account.Login.extract_code_from_url(code_url)
auth_code = await Login.get_ms_token(code)
print(f"Refresh token: {auth_code['refresh_token']}")
xbl_token = await microsoft_account.Login.get_xbl_token(auth_code["access_token"])
xsts_token = await microsoft_account.Login.get_xsts_token(xbl_token["Token"])
uhs = xbl_token["DisplayClaims"]["xui"][0]["uhs"]
mc_token = await microsoft_account.Login.get_minecraft_access_token(xsts_token["Token"], uhs)
await have_minecraft(mc_token["access_token"])
login_data = {
"access_token": mc_token["access_token"],
"refresh_token": auth_code["refresh_token"],
"expires_in": auth_code["expires_in"],
"uhs": uhs,
"xsts_token": xsts_token["Token"],
"xbl_token": xbl_token["Token"]
}
return login_data["access_token"]
if __name__ == "__main__":
access_token = asyncio.run(login_microsoft_account())
print(f"Access token: {access_token}")
Documentation & More Examples
Comparison: This Fork vs. JakobDev/minecraft-launcher-lib
| Feature/Design | This Fork | JakobDev Original |
|---|---|---|
| Python Version Support | 3.10+, more complete type annotations | 3.7+, partial type annotations |
| Logging System | Built-in setup_logger, file & console output |
No built-in logging, user must implement |
| Microsoft Login Flow | Example & API fully async/await | All sync |
| Dependencies | aiofiles, aiohttp, requests, requests-mock | requests |
| Documentation | Primarily in Chinese, tailored for TW/Chinese users | English |
| Branch Strategy | main/dev auto-sync (GitHub Actions) | Single main branch |
| Others | Optimized for async/await and type annotations | Focus on broad compatibility |
Please refer to both the original and this fork to choose the version that best fits your needs!
Contributing
PRs and issues are welcome!
Acknowledgements
Thanks to tomsik68 for documenting Minecraft launcher internals.
Thanks to JakobDev for the original code (BSD-2).
Metadata
Release files for async-mc-launcher-core 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| async_mc_launcher_core-0.4.tar.gz | 66.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| async_mc_launcher_core-0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 144.6 kB
Release files / async_mc_launcher_core-0.4.tar.gz
| Download URL | async_mc_launcher_core-0.4.tar.gz |
|---|---|
| Size | 66.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49c94f112d205e33eb2f2320b89ac5aafb424cbc1143da4db341a15f458aded3
|
|
BLAKE2b-256 checksum How to use checksums |
3ab8da3f82fa9e8fe1a728f40c2e57c181d27c5dc6cc823dac4e38326fd6f789
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.21
|
Release files / async_mc_launcher_core-0.4-py3-none-any.whl
| Download URL | async_mc_launcher_core-0.4-py3-none-any.whl |
|---|---|
| Size | 78.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fadf3a04671ea9c2c750146815fdfa0edae974a8e27de6526c346f93dad7d104
|
|
BLAKE2b-256 checksum How to use checksums |
bcc1c7335274b89bd0a6c5e0d823735e891e33ac57463727e69bf5308358117d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.21
|
Security for async-mc-launcher-core 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.