vanilla_launcher

vanilla_launcher contains some functions for interacting with the Vanilla Minecraft Launcher

load_vanilla_launcher_profiles(minecraft_directory: str | PathLike) list[VanillaLauncherProfile]

Loads the profiles of the Vanilla Launcher from the given Minecraft directory

Parameters:

minecraft_directory (str | PathLike) – The Minecraft directory

Returns:

A List with the Profiles

Return type:

list[VanillaLauncherProfile]

vanilla_launcher_profile_to_minecraft_options(vanilla_profile: VanillaLauncherProfile) MinecraftOptions

Converts a VanillaLauncherProfile into a Options dict, that can be used by get_minecraft_command(). You still need to add the Login Data to the Options before you can use it.

Parameters:

vanilla_profile (VanillaLauncherProfile) – The profile as returned by load_vanilla_launcher_profiles()

Raises:

InvalidVanillaLauncherProfile – The given Profile is invalid

Returns:

The Options Dict

Return type:

MinecraftOptions

get_vanilla_launcher_profile_version(vanilla_profile: VanillaLauncherProfile) str

Returns the Minecraft version of the VanillaProfile. Handles latest-release and latest-snapshot.

Parameters:

vanilla_profile (VanillaLauncherProfile) – The Profile

Raises:

InvalidVanillaLauncherProfile – The given Profile is invalid

Returns:

The Minecraft version

Return type:

str

add_vanilla_launcher_profile(minecraft_directory: str | PathLike, vanilla_profile: VanillaLauncherProfile) None

Adds a new Profile to the Vanilla Launcher

Parameters:
  • minecraft_directory (str | PathLike) – The Minecraft directory

  • vanilla_profile (VanillaLauncherProfile) – The new Profile

Raises:

InvalidVanillaLauncherProfile – The given Profile is invalid

Return type:

None

do_vanilla_launcher_profiles_exists(minecraft_directory: str | PathLike) bool

Checks if profiles from the vanilla launcher can be found

Parameters:

minecraft_directory (str | PathLike) – The Minecraft directory

Returns:

If profiles exists

Return type:

bool

View the source code of this module