Skip to content

legopitstop/mcpath

Repository files navigation

mcpath

Tests PyPI Python Downloads Status Code style: black Issues

Get paths to Minecraft Java, Bedrock, Preview, and Education Edition folders, launchers, executables and java runtime.

Installation

Install the module with pip:

pip3 install mcpath

Update existing installation: pip3 install mcpath --upgrade

Supported Platforms

Java Bedrock Preview/Beta Education
Android [1]
Darwin [3]
iOS [2]
Linux [4]
Windows
  1. With Pydroid 3
  2. With Pyto
  3. Has not been tested.
  4. With mcpelauncher.

Requirements

Name Usage
requests Get runtime component and version using Mojang's API
requests-cache For caching version data.

Examples

Saves

import mcpath

print(mcpath.java.get_saves_dir())
# C:\Users\USER\AppData\Roaming\.minecraft\saves

.minecraft

import mcpath

print(mcpath.java.get_root_dir())
# C:\Users\USER\AppData\Roaming\.minecraft

Game

import mcpath

print(mcpath.java.get_game_dir())
# D:\minecraft

Java Runtime Executable

import mcpath

print(mcpath.java.get_runtime('1.21.3'))
# C:\Users\USER\AppData\Local\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\runtime\java-runtime-delta\windows-x64\java-runtime-delta\bin\java.exe