utils

utils contains a few functions for helping you that doesn’t fit in any other category

get_minecraft_directory() str

Returns the default path to the .minecraft directory

Return type:

str

get_latest_version() LatestMinecraftVersions

Returns the latest version of Minecraft

Return type:

LatestMinecraftVersions

get_version_list() List[MinecraftVersionInfo]

Returns all versions that Mojang offers to download

Return type:

List[MinecraftVersionInfo]

get_installed_versions(minecraft_directory: str | PathLike) List[MinecraftVersionInfo]

Returns all installed versions

Parameters:

minecraft_directory (str | PathLike) – The path to your Minecraft directory

Return type:

List[MinecraftVersionInfo]

get_available_versions(minecraft_directory: str | PathLike) List[MinecraftVersionInfo]

Returns all installed versions and all versions that Mojang offers to download

Parameters:

minecraft_directory (str | PathLike) – The path to your Minecraft directory

Return type:

List[MinecraftVersionInfo]

get_java_executable() str

Tries the find out the path to the default java executable

Return type:

str

get_library_version() str

Returns the version of minecraft-launcher-lib

Return type:

str

generate_test_options() MinecraftOptions

Generates options to launch minecraft. Useful for testing. Do not use in production.

Return type:

MinecraftOptions

is_version_valid(version: str, minecraft_directory: str | PathLike) bool

Checks if the given version exists

Parameters:
  • version (str) – A Minecraft version

  • minecraft_directory (str | PathLike) – The path to your Minecraft directory

Return type:

bool

get_minecraft_news(page_size: int = 20) Articles

Get the news from minecraft.net

Parameters:

page_size (int) – The Page Size (default 20)

Return type:

Articles

is_vanilla_version(version: str) bool

Checks if the given version is a vanilla version

Parameters:

version (str) – A Minecraft version

Return type:

bool

is_platform_supported() bool

Checks if the current platform is supported

Return type:

bool

is_minecraft_installed(minecraft_directory: str | PathLike) bool

Checks, if there is already a existing Minecraft Installation in the given Directory

Parameters:

minecraft_directory (str | PathLike) – The path to your Minecraft directory

Returns:

Is a Installation is found

Return type:

bool

View the source code of this module