# Portable Minecraft Launcher
An easy to use portable Minecraft launcher in only one Python script !
This single-script launcher is still compatible with the official (Mojang) Minecraft Launcher stored in `.minecraft` and use it.
***[Mojang authentication now available!](#mojang-authentication)***

*This launcher is tester for Python 3.8 & 3.6, further testing using other versions are welcome.*
***[Download the script!](https://raw.githubusercontent.com/mindstorm38/portablemc/master/portablemc.py)***
Once you have the script, you can launch it using python (e.g `python portablemc.py`).
## Table of contents
- [Arguments](#arguments)
- [Mojang authentication](#mojang-authentication)
- [Minecraft version](#minecraft-version)
- [Offline mode](#username-and-uuid-manual-offline-mode)
- [Main & working directories](#main--working-directory)
- [Demo mode](#demo-mode)
- [Resolution](#window-resolution)
- [No start mode](#no-start-mode)
- [Customize JVM](#customize-jvm-java-virtual-machine)
- [Usage examples](#examples)
# Arguments
The launcher support various arguments that make it really useful and faster than the official launcher
to test the game in offline mode *(custom username and UUID)*, or demo mode for example.
*You can read the complete help message using `-h` argument.*
## Mojang authentication
Do you want to authenticate using your Mojang account ?
It's now possible using `-l` *(`--login`)* followed by your email or username (for legacy account).
You will be asked for the password once the launcher is start. *If you don't want cache the session,
you can use `-t` (`--temp-login`) flag.*
> Session are stored in a separated file from official launcher *(`.minecraft/portablemc_tokens`)*,
note that no trace of your password remain in this file, so don't worry about using this !
> These arguments override arguments for offline username and UUID.
Your session is cached and you want to invalidate it ? Use `--logout` followed by your email or username.
This do not start the game.
## Minecraft version
By default the launcher starts the latest release version, to change this, you can use the `-v` *(`--version`)* followed by the
version name, or `snapshot` to target the latest snapshot, `release` does the same for latest release.
Using the `-s` *(`--search`)* flag you can tell this launcher to only search for all versions prefixed by the specified version of `-v` argument,
this stop the application just after searching. Exit codes: `15` if no version was found, else `0`.
> Note that latest version of Java may not work for old versions of Minecraft.
## Username and UUID (manual offline mode)
By default, a random player [UUID](https://fr.wikipedia.org/wiki/Universally_unique_identifier) is used, and the username is
extracted from the first part of the UUID's represention *(for a `110e8400-e29b-11d4-a716-446655440000` uuid, the username will be `110e8400`)*.
You can use `-u` *(`--username`)* followed by the username and `-i` *(`--uuid`)* with your user UUID.
> Note that even if you have set another UUID, the username will be the same as default (with extracted part from default UUID).
## Main & working directory
You can now configure directories used for game to work. These directories are:
- `--main-dir`: this directory store libraries, assets, versions, binaries (at runtime) and launcher cache *(default values [here](https://minecraft-fr.gamepedia.com/.minecraft))*
- `--work-dir`: this directory store game files like save, resource packs or logs *(if not specified, it is the same as main directory)*.
> **Shortcuts versions of previous arguments (`-md`, `-wd`) will be removed in future versions because it's not standard to have short argument with two letters.**
> When using a main directory with portablemc for the first time, luncher will ask you to continue or not.
## Demo mode
Demo mode is a mostly unknown feature that allows to start the game with a restricted play duration, it is disabled by default.
Use `--demo` to enable.
## Window resolution
You can set the default window resolution *(does not affect the game if already in fullscreen mode)* by using `--resol` followed by
`<width>x<height>`, `width` and `height` are positive integers.
## No start mode
By using `--nostart` flag, you force the launcher to download all requirements to the game, but does not start it.
## Customize JVM (Java Virtual Machine)
By default the launcher use the `javaw` executable to launch Minecraft, if you want to
change this executable, use the `--jvm` argument followed by the executable.
You can also set JVM arguments string using the `--jvm-args`. By defaults the JVM arguments are the same as the officiel launcher:
```
-Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
```
> The `--java` argument is used if `--jvm` is not defined, but it will be removed in future versions.
# Examples
```
python portablemc.py Start latest Minecraft version using offline mode and random username and UUID
python portablemc.py -l <email|username> Start latest Minecraft version using mojang authentication for specific email or username (legacy)
python portablemc.py -tl <email|username> Same as previous command, but do not cache the session (you need to re-enter password on each launch)
python portablemc.py --nostart Download all components of the latest Minecraft version but do not start the game
python portablemc.py --logout <email|username> Logout from a session
python portablemc.py -u OfflineTest -v 1.15 Start 1.15 Minecraft version in offline mode with a username 'OfflineTest' and random UUID
python portablemc.py -sv 1.7 Search for all versions starting with "1.7"
python portablemc.py --main-dir /tmp/mc Start latest Minecraft version in /tmp/mc instead of .minecraft
```

kudrei
- 粉丝: 49
- 资源: 4757
最新资源
- 基于Spring Boot和SSM框架的ERP进销存管理系统源码:单据流转、精细化的物流信息管理,前端细节设计,权限管理,透明背景与关联单据优化,基于Spring Boot与SSM框架的ERP进销存管
- 燃料电池与超级电容复合能量管理策略:Simulink仿真模型研究及其在混合储能系统中的应用,燃料电池与超级电容复合能量管理策略:Simulink仿真模型研究及其在混合储能系统中的应用,燃料电池电池超级
- 西门子PLC1500控制Fanuc机器人汽车焊装生产线自动化:Profinet通讯与多种模块集成应用,西门子PLC1500大型程序掌控汽车焊装生产线:涵盖Fanuc机器人、触摸屏、Profinet通讯
- 基于MATLAB的综合能源系统优化调度:结合需求响应与碳交易机制研究,综合能源系统优化调度:Matlab程序制定与碳交易机制下的综合需求响应应用,matlab程序制定,综合能源系统优化调度,综合需求响
- 电力市场出清程序:基于IEEE 14节点输电阻塞分析的机组与节点边际电价求解,利用拉格朗日乘子计算最优发电成本,采用MATLAB linprog函数实现,具备广泛参考价值 ,电力市场出清程序:基于IE
- 永磁同步电机双矢量模型预测控制仿真研究:MATLAB下的PMSM控制策略探索,永磁同步电机双矢量模型预测控制仿真研究:基于MATLAB平台的PMSM控制策略探索,永磁同步电机双矢量模型预测控制仿真PM
- 【毕业设计】Python的Django-html开放领域事件抽取系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html旅游城市关键词分析系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html旅游景点方面级别情感分析语料库与模型源码(完整前后端+mysql+说明文档+LW+PPT).zip
- LabVIEW利用DLL接口操作结构体指针:获取嵌套指针与混合类型数据处理策略,LabVIEW利用DLL获取结构体指针内嵌套指针元素及多种类型数据的实践方法,LabVIEW通过dll获取结构体指针中的
- 【毕业设计】Python的Django-html某大学学生影响力分析系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html棉花数据平台建设与可视化系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html小波变换的数字水印研究系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】Python的Django-html语音识别的智能垃圾分类系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 基于蒙特卡洛模拟的分布式电源(风光)概率潮流Matlab仿真研究:IEEE 33节点系统的分析与应用(包括牛拉法潮流计算与电压特性前后对比),基于蒙特卡洛方法的分布式电源(风光)概率潮流计算Matla
- 【毕业设计】Python的Django-html知识图谱的百科知识问答平台源码(完整前后端+mysql+说明文档+LW+PPT).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



评论1