Options
All
  • Public
  • Public/Protected
  • All
Menu

Core Engine API

Index

Type aliases

ItemInstanceArray

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

jbyte: number

Type used to mark Java bytes

Variables

Const BlockID

BlockID: object

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

Const ItemID

ItemID: object

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

__config__

__config__: Config

Main mod configuration manager, settings are stored in config.json file

__dir__

__dir__: string

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

__mod__

__mod__: Object

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

__name__

__name__: string

Mod name

__packdir__

__packdir__: string

Full path to current Horizon pack directory

Functions

EXPORT

  • EXPORT(name: string, lib: any): void

EntityAIWatcher

  • EntityAIWatcher(customPrototype: any): any

EntityModel

  • EntityModel(parentModel: any): any

EntityModelWatcher

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

GameObject

  • GameObject(name: any, Prototype: any): any

IMPORT

  • 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

    Parameters

    • 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

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

    Parameters

    • 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

ItemExtraData

  • ItemExtraData(): any

LIBRARY

  • LIBRARY(description: object): void

RenderMesh

  • RenderMesh(): any

WRAP_NATIVE

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

    Parameters

    • name: string

      name of the module, as registered from native code

    Returns object

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

__debug_typecheck__

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

    Returns void

alert

  • alert(arg: string): any

getCoreAPILevel

  • getCoreAPILevel(): number

getMCPEVersion

  • 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

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

runCustomSource

  • 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.

    Parameters

    • 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

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

    Parameters

    • func: () => void

      function to be run in the main thread

        • (): void
        • Returns void

    Returns void

Generated using TypeDoc