Skip to main content

Core Engine

Index

Namespaces

Classes

Interfaces

Variables

Type Aliases

Enumerations

Functions

Variables

constBlockID

Object containing custom block string IDs as keys and their numeric IDs as values.

constECS_INVALID_ENTITY
since: 2.3.1b115

ECS_INVALID_ENTITY: object

constECS_TAG_OBJECT
since: 2.3.1b115

ECS_TAG_OBJECT: object

constEntityManager
since: 2.3.1b115

EntityManager: EcsEntityManager

constItemID

Object containing custom item string IDs as keys and their numeric IDs as values.

constUpdatableAPI

UpdatableAPI: typeof Updatable
That feature is obsolete

Use Updatable instead.

__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__

Mostly internal variable determined to be useful for control mod lifecycle, configuration and executables.

__modpack__
since: 2.2.1b85

Full path to current modpack (like innercore) directory.

__name__

__name__: string

Name property, generally loaded from mod.info.

__packdir__

__packdir__: string

Full path to current selected pack (like Inner Core) directory.

__version__
since: 2.2.0b75

__version__: number

Minecraft version code, for now, always 16.

Type Aliases

ArmorType

ArmorType: helmet | chestplate | leggings | boots

String types of armor to be specified when calling Item.createArmorItem.

DefaultRenderTemplate

DefaultRenderTemplate: ArmorType

Default render templates used inside of Inner Core, currently there are only default armor models.

ItemInstanceArray

ItemInstanceArray: [number, number, number, ItemExtraData?]

Array of three or four elements representing item ID, count, data and extra respectively. Uses in block drop functions.

Nullable

Nullable<T>: T | null

Most methods must return null if value is not presented.


Type parameters

  • T

Scriptable

Scriptable: {}

Flattened hieracly, extendable in declarations.


Type declaration

  • [key string]: any

TransferPolicy

Backwards compatibility.

jbyte

jbyte: number

Type used to mark Java bytes.

Functions

ConfigureMultiplayer

  • ConfigureMultiplayer(args: { isClientOnly: boolean; name?: string; version?: string }): void
  • Function that must be written in launcher.js to enable multiplayer configuration. Client mods must not affect on the world. They will not be taken into account in mod synchronization during the connection.


    Parameters

    • args: { isClientOnly: boolean; name?: string; version?: string }
      • isClientOnly: boolean

        If true, mod is only client.

      • optionalname: string = “auto”

        Unique readable network name of the mod.

        More about capabilities

        Value "auto" here means determine mod.info property, which is preferred in most cases.

      • optionalversion: string = “auto”

        Mod version.

        More about capabilities

        Value "auto" here means determine mod.info property, which is preferred in most cases.

    Returns void

EXPORT

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


    Parameters

    • 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

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

    • optionalvalue: 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

LIBRARY

  • LIBRARY(description: { api: CoreEngine | AdaptedScript | PrefsWinAPI | Preloader; 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.


    Parameters

    • description: { api: CoreEngine | AdaptedScript | PrefsWinAPI | Preloader; dependencies?: string[]; name: string; shared: boolean; version: number }

      object containing all the required information about the library

      • api: CoreEngine | AdaptedScript | PrefsWinAPI | Preloader

        API name.

      • optionaldependencies: 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 latest library version if different mods have different library version installed.

    Returns void

WRAP_JAVA

  • WRAP_JAVA<T>(name: string): T
  • Allows to create new JS modules imported from Java code and use it in the mod.


    Type parameters

    • T = any

    Parameters

    • name: string

      name of the module, as registered from Java code

    Returns T

    JS module, implemented in Java code.

WRAP_NATIVE

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


    Type parameters

    • T = any

    Parameters

    • name: string

      name of the module, as registered from native code

    Returns T

    JS module, implemented in native (C++) code.

__debug_typecheck__

  • __debug_typecheck__(obj: any): string
  • internal

    Method provided to log inherited Rhino class type and determine which instance is used.


    Parameters

    • obj: any

    Returns string

    Something like java.lang.Class.getName().

alert

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


    Parameters

    • message: any

    Returns void

getCoreAPILevel

  • getCoreAPILevel(): number
  • Returns number

    Current Core Engine API level (12).

getMCPEVersion

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

    Minecraft version information in several variants.

    • array: number[]

      Array containing three version numbers.

    • main: number

      Version number.

    • str: string

      String version representation, three dot-separated numbers.

importLib

  • importLib(name: string, value?: string): void
  • Same as IMPORT, consider using IMPORT instead.


    Parameters

    • name: string
    • optionalvalue: string

    Returns void

injectBindingsIntoScope

  • injectBindingsIntoScope(moduleName: string, obj: object, allowOverrides: boolean): void
  • since: 3.1.0b126

    Parameters

    • moduleName: string
    • obj: object
    • allowOverrides: boolean

    Returns void

injectModuleIntoScope

  • injectModuleIntoScope(moduleName: string, obj: object, allowOverrides: boolean): void
  • since: 3.1.0b126

    Parameters

    • moduleName: string
    • obj: object
    • allowOverrides: boolean

    Returns void

injectModulesIntoScope

  • injectModulesIntoScope(obj: object, allowOverrides: boolean): void
  • since: 3.1.0b126

    Parameters

    • obj: object
    • allowOverrides: boolean

    Returns void

runCustomSource

  • runCustomSource(name: string, scope?: object): void
  • Runs custom source in the specified context by it's 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

    • optionalscope: object

      additional scope to be added to the current context

    Returns void

runOnClientThread

  • runOnClientThread(func: () => void): void
  • since: 2.2.1b96

    Runs specified function in the client thread. Same as runOnMainThread, but for the client side.


    Parameters

    • func: () => void

      function to be run in the client thread

      Returns void

    runOnMainThread

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


      Parameters

      • func: () => void

        function to be run in the main thread

        Returns void