Namespace Game

Module that provides some general game-related functions.

Functions

  • Displays android.app.AlertDialog with given message and dialog title. Message can be mixed with HTML-like formatting, for example <b>I'm a bold</b><br/><i>I'm a italic</i>.

    Parameters

    • message: any

      message to be displayed

    • title: any

      title before message

    Returns void

  • String containing current Core Engine version.

    Returns string

    "2.1"

  • Returns number

    Current level game mode, one of the EGameMode values.

  • String containing current Minecraft version.

    Returns string

    "1.16.201" or "1.11.4"

  • Retrieves option by requested name, which instance could be used for getting values.

    Parameters

    • name: string

      option name, suitable names could be found in your "options.txt" file or via Game.getOptions

    Returns Nullable<Option>

    2.4.0b122

  • Fetches available option names, which can be used to obtain values via Game.getOption.

    Returns string[]

    2.4.0b122

  • Returns boolean

    true if the current callback function has already been prevented from being called in Minecraft using Game.prevent, false otherwise.

  • Allows you to determine whether current instance of game has a client or not (clientless game requires a server core, e.g. Zote Core (GitHub)).

    Returns boolean

    2.3.1b116

  • Parameters

    • OptionalplayerUid: number

    Returns boolean

    true if item spending allowed or player in creative.

  • Writes message to the chat. Message can be formatted using EColor values.

    Parameters

    • message: any

      message to be displayed

    Returns void

  • Prevents current callback function from being called in Minecraft. For most callbacks it prevents default game behavior.

    Returns void

  • Sets game difficulty, one of EGameDifficulty values.

    Parameters

    • difficulty: number

      game difficulty to be set

    Returns void

  • Sets current level game mode.

    Parameters

    • mode: number

      new game mode, should be one of the EGameMode values

    Returns void

  • Emulates native pressing of the back button inside the game, for example, necessary to close current window. *

    Returns void

    2.0.4b35

  • Writes message above the hot bar. Message can be formatted using EColor values.

    Parameters

    • message: any

      message to be displayed

    Returns void

Type Aliases

OptionType: number

Option types, which can be used to determine option data:

Type Name Description
0 None Internal type, it cannot be used.
1 Boolean true or false switch.
2 Float Field with float value.
3 Float Slider Slider with float value in specified ranges.
4 String Field with string text value.
5 Int Field with integer value.
6 Int Slider Slider with integer value in specified ranges.

2.4.0b122

Variables

isDeveloperMode: boolean

true if developer mode was enabled in Inner Core config.

spendItemsInCreative: boolean

true if Inner Core config allows spending items in creative.

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.