Перейти к основному содержанию

Game

Module that provides some general game-related functions.

Index

Interfaces

Option

Option:

Option instance, which can be obtained via Game.getOption.

@since

2.4.0b122

canModify

  • canModify(): boolean
  • Can option be changed in game settings.


    Returns boolean

getBoolean

  • getBoolean(): boolean
  • Gets boolean value of option, suitable for boolean OptionType.


    Returns boolean

getFloat

  • getFloat(): number
  • Gets boolean value of option, suitable for float and float slider OptionTypes.


    Returns number

getFloatMax

  • getFloatMax(): number
  • Gets maximum value in slider range, suitable for float slider OptionType.


    Returns number

getFloatMin

  • getFloatMin(): number
  • Gets minimum value in slider range, suitable for float slider OptionType.


    Returns number

getInt

  • getInt(): number
  • Gets boolean value of option, suitable for int and int slider OptionTypes.


    Returns number

getIntMax

  • getIntMax(): number
  • Gets maximum value in slider range, suitable for int slider OptionType.


    Returns number

getIntMin

  • getIntMin(): number
  • Gets minimum value in slider range, suitable for int slider OptionType.


    Returns number

getPointer

  • getPointer(): number
  • internal

    Returns number

getString

  • getString(): string
  • Gets boolean value of option, suitable for string OptionType.


    Returns string

getType

  • getType(): number
  • Gets numeric option type, which can be used to determine data type and retrieve proper value.


    Returns number

Type Aliases

OptionType

OptionType: number

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

TypeNameDescription
0NoneInternal type, it cannot be used.
1Booleantrue or false switch.
2FloatField with float value.
3Float SliderSlider with float value in specified ranges.
4StringField with string text value.
5IntField with integer value.
6Int SliderSlider with integer value in specified ranges.
@since

2.4.0b122

Variables

isDeveloperMode
internal

isDeveloperMode: boolean

true if developer mode was enabled in Inner Core config.

spendItemsInCreative
internal

spendItemsInCreative: boolean

true if Inner Core config allows spending items in creative.

Functions

dialogMessage

  • dialogMessage(message: any, title: any): void
  • 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

getDifficulty

  • getDifficulty(): number

getEngineVersion

  • getEngineVersion(): string
  • String containing current Core Engine version.


    Returns string

    "2.1"

getGameMode

  • getGameMode(): number

  • Returns number

    Current level game mode, one of the EGameMode values.

getMinecraftVersion

  • getMinecraftVersion(): string
  • String containing current Minecraft version.


    Returns string

    "1.16.201" or "1.11.4"

getOption

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

    @since

    2.4.0b122


    Parameters

    • name: string

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

    Returns Nullable<Option>

getOptions

  • getOptions(): string[]
  • Fetches available option names, which can be used to obtain values via Game.getOption.

    @since

    2.4.0b122


    Returns string[]

isActionPrevented

  • isActionPrevented(): boolean

  • Returns boolean

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

isDedicatedServer

  • isDedicatedServer(): boolean
  • 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)).

    @since

    2.3.1b116


    Returns boolean

isItemSpendingAllowed

  • isItemSpendingAllowed(playerUid?: number): boolean

  • Parameters

    • optionalplayerUid: number

    Returns boolean

    true if item spending allowed or player in creative.

message

  • message(message: any): void
  • Writes message to the chat. Message can be formatted using EColor values.


    Parameters

    • message: any

      message to be displayed

    Returns void

prevent

  • prevent(): void
  • Prevents current callback function from being called in Minecraft. For most callbacks it prevents default game behavior.


    Returns void

setDifficulty

  • setDifficulty(difficulty: number): void
  • Sets game difficulty, one of EGameDifficulty values.


    Parameters

    • difficulty: number

      game difficulty to be set

    Returns void

setGameMode

  • setGameMode(mode: number): void
  • Sets current level game mode.


    Parameters

    • mode: number

      new game mode, should be one of the EGameMode values

    Returns void

simulateBackPressed

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

    @since

    2.0.4b35


    Returns void

tipMessage

  • tipMessage(message: any): void
  • Writes message above the hot bar. Message can be formatted using EColor values.


    Parameters

    • message: any

      message to be displayed

    Returns void