• Public
  • Public/Protected
  • All

Core Engine API


Type aliases


ItemInstanceArray: number[]

Array of theee elements representing item id, count and data respectively. Used in many old functions and when extra data is not required


jbyte: number

Type used to mark Java bytes


Const BlockID

BlockID: {}

Object containing custom block string ids as keys and their numeric ids as values

Type declaration

  • [key: string]: number

Const ItemID

ItemID: {}

Object containing custom item string ids as keys and their numeric ids as values

Type declaration

  • [key: string]: number


__config__: Config

Main mod configuration manager, settings are stored in config.json file. For more information about config.json, see Mod Configuration Files


__dir__: string

Full path to the mod's directory, ends with "/"


__mod__: Object

Java object of the mod, contains some useful values and methonds


__name__: string

Mod name


__packdir__: string

Full path to current Horizon pack directory



  • EXPORT(name: string, lib: any): void
  • Exports object from library using specified name


    • name: string

      object name to be used when calling IMPORT. If the name contains a column (":"), the number after column is used to specify version of the library this export corresponds to. To provide backward compatibility, library authors can use multiple exports for different library versions inside a single file. This mechanism currently works only for library dependencies

    • lib: any

      object to be exported with specified name, can be of any valid js/java type

    Returns void


  • EntityAIWatcher(customPrototype: any): any


  • EntityModel(parentModel: any): any


  • EntityModelWatcher(entity: number, model: any): any


  • IMPORT(name: string, value?: string): void
  • Imports library dependency. Libraries should be stored in the *"libraryDir"* directory, specified in your build.config. You can either import the whole library or single function/value using value parameter


    • name: string

      library name specified in the library's EXPORT declaration

    • Optional value: string

      name of the function or value you wish to import, or "*" to import the whole library. Defaults to importing the whole library

    Returns void


  • IMPORT_NATIVE(name: string, target: object): any
  • Injects methods from C++ into the target object to use in the mod


    • name: string

      name of the module, as registered from native code

    • target: object

      target object, where all the methods from native module will be injected

    Returns any


  • LIBRARY(description: { api: string; dependencies: string[]; name: string; shared: boolean; version: number }): void
  • Library declaration, specifies all the information about library it is called from. Cannot be called from user code.


    • description: { api: string; dependencies: string[]; name: string; shared: boolean; version: number }

      object containing all the required information about the library

      • api: string

        API name, one of the "CoreEngine", "AdaptedScript" or "PrefsWinAPI" strings

      • dependencies: string[]

        List of names of libraries that should be loaded before the current library is loaded. Every entry should be either just a library name or library name and version separated by a column (":")

      • name: string

        Library name, used to avoid conflicts when several mods have the same library installed

      • shared: boolean

        If set to true, the context of the library is shared between mods to allow for better integration

      • version: number

        Library version, used to load the lates library version if different mods have different library version installed

    Returns void


  • WRAP_NATIVE(name: string): object
  • Allows to create new JS modules imported from C++ code and use it in the mod


    • name: string

      name of the module, as registered from native code

    Returns object

    js module, implemented in native (C++) code


  • __debug_typecheck__(): void
  • Empty function used to verify Rhino functionality. Should not be called by hand

    Returns void


  • alert(arg: any): any
  • Displays android.widget.Toast with specified message. If this function is called more then once, messages are stacked and displayed together


    • arg: any

    Returns any


  • getCoreAPILevel(): number


  • getMCPEVersion(): { array: number[]; main: number; str: string }
  • Returns { array: number[]; main: number; str: string }

    minecraft version information in some readable form

    • array: number[]

      array containing three version numbers

    • main: number

      version number, calculated as array[0] * 17 + array[1]

    • str: string

      string version representation, three dot-separated numbers


  • importLib(name: string, value?: string): void


  • runCustomSource(name: string, scope?: object): void
  • Runs custom source in the specified context by its name. Define custom sources using *"sourceType": "custom"* for the source in your build.config.


    • name: string

      path to the executable. Can be built the way built-in source types are built

    • Optional scope: object

      additional scope to be added to the current context

    Returns void


  • runOnMainThread(func: () => void): void
  • Runs specified funciton in the main thread


    • func: () => void

      function to be run in the main thread

        • (): void
        • Returns void

    Returns void

Generated using TypeDoc