Class Instance

An instance is what the name entails. An instance of the game Minecraft containing Minecraft specific data. This information on where the game is stored and the like. The mods installed and what not.

Hierarchy

  • Instance

Constructors

Properties

assets: Partial<AssetIndex>
detach: boolean
env: {
    [key: string]: string;
}

Type declaration

  • [key: string]: string
getJarModPriority: ((this) => Promise<{
    [key: string]: number;
} & WrappedObj>) = modsHandler.getJarModPriority

Type declaration

    • (this): Promise<{
          [key: string]: number;
      } & WrappedObj>
    • Gets the load order of minecraft jars in jar mod loader.

      Parameters

      Returns Promise<{
          [key: string]: number;
      } & WrappedObj>

getMetaPaths: ((this) => Promise<InstanceMetaPaths>) = metaHandler.getMetaPaths

Type declaration

getMods: ((this) => Promise<ModInfo[]>) = metaHandler.getMods

Type declaration

    • (this): Promise<ModInfo[]>
    • Gets information about mods in this instance. This includes the loader version plus some general information about the mod author and mod itself. This will also provide you the icon for a set mod if it can be obtained.\

      Works with Legacy forge, forge, fabric, riftloader and liteloader

      Parameters

      Returns Promise<ModInfo[]>

getResourcePacks: ((this) => Promise<MetaResourcePack[]>) = metaHandler.getResourcePacks

Type declaration

    • (this): Promise<MetaResourcePack[]>
    • Gets information about the installed resource and texture packs of this instance. This includes information like the pack icon, name, description, legal documents and credits.

      Parameters

      Returns Promise<MetaResourcePack[]>

getWorlds: ((this) => Promise<MetaSave[]>) = metaHandler.getWorlds

Type declaration

    • (this): Promise<MetaSave[]>
    • Gets some general information about all the world files in this instance. It also decodes the level.DAT file for you and returns the decoded file as a JSON file.

      It also decodes the player data stored in the "playerdata" and "stats" subfolder in newer versions of the game.

      Parameters

      Returns Promise<MetaSave[]>

id: string
install: ((this) => Promise<default>) = launchHandler.install

Type declaration

    • (this): Promise<default>
    • Runs the installer script without launching MC

      Parameters

      Returns Promise<default>

      The instance's version object.

      See

      getVersion if you just want the instance's version

installForge: ((this, forge?) => Promise<string>) = modsHandler.installForge

Type declaration

    • (this, forge?): Promise<string>
    • Install forge in this instance.

      Parameters

      Returns Promise<string>

javaPath: string
launch: ((this, token, resolution?) => Promise<void>) = launchHandler.launch

Type declaration

    • (this, token, resolution?): Promise<void>
    • This function is used to launch the game. It also runs the install script for you. This essentially does an integrity check.

      Parameters

      • this: Instance
      • token: Player

        The player login token

      • Optional resolution: {
            height: string;
            width: string;
        }

        Optional information defining the game's resolution

        • height: string
        • width: string

      Returns Promise<void>

meta: any

This is a custom field for launcher authors. It can safely be ignored

name: string
noLegacyFix: boolean
pack: ((this, config) => Promise<Partial<VersionJson>>) = modsHandler.pack

Type declaration

    • (this, config): Promise<Partial<VersionJson>>
    • An version of the wrap function that takes an object as a variable instead of the mess the base function takes.

      Parameters

      Returns Promise<Partial<VersionJson>>

path: string
ram: number
version: string
wrap: ((this, baseUrl, save, name?, forge?, trimMisc?) => Promise<Partial<VersionJson>>) = modsHandler.wrap

Type declaration

    • (this, baseUrl, save, name?, forge?, trimMisc?): Promise<Partial<VersionJson>>
    • Wraps up an instance in a prepackaged format that can be easily uploaded to a server for distribution

      Parameters

      • this: Instance
      • baseUrl: string

        The base URL the generated files will be stored within on your server. For example http://yourawesomdomain.net/path/to/files/

      • save: string | Dir

        The file GMLL will generate the final files on.

      • name: string = ...

        The name that should be used to identify the generated version files

      • Optional forge: File | {
            jar: string | File;
        }

        The path to a forge installation jar

      • trimMisc: boolean = false

        Gets rid of any unnecessary miscellaneous files

      Returns Promise<Partial<VersionJson>>

defJVM: LaunchArguments = ...

Do not mess with unless you know what you're doing. Some older versions may not launch if information from this file is missing.

defaultGameArguments: string[] = ...

The default game arguments, don't mess with these unless you know what you are doing

jarMod: ((metaPaths, version) => Promise<File>) = modsHandler.jarMod

Type declaration

    • (metaPaths, version): Promise<File>
    • Used to modify minecraft's jar file (Low level)

      Parameters

      Returns Promise<File>

oldJVM: string[] = ...

Additional arguments added for legacy versions

Methods

  • Inject custom assets into the game.

    Parameters

    • key: string

      The asset key

    • path: string | File

      The path to the asset file in questions...it must exist!

    Returns {
        hash: string;
        ignore: boolean;
        size: number;
    }

    • hash: string
    • ignore: boolean
    • size: number
  • This will tell GMLL to rerun some of the install scripts it normally skips upon a second "install" call. This won't reset worlds or rewrite dynamic files. Use this if, for instance, forge failed to install.

    Returns void

  • Injects a set selection of images into the asset files and sets them as the icon for this instance

    Parameters

    • Optional x32: string | File
    • Optional x16: string | File
    • Optional mac: string | File

    Returns void

Generated using TypeDoc