Options
All
  • Public
  • Public/Protected
  • All
Menu

Core Engine v2.1 API

Index

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

ArmorType: "helmet" | "chestplate" | "leggings" | "boots"

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

DefaultRenderTemplate: ArmorType

Default render templates used inside of InnerCore, currently there are only default armor models

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<T>: T | null

Type Parameters

  • T

jbyte: number

Type used to mark Java bytes

Variables

BlockID: {}

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

Type declaration

  • [key: string]: number
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 {@page Mod Configuration Files}

__dir__: string

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

__mod__: ModJsAdapter

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

__modpack__: ModPackJsAdapter

Full path to current Inner Core modpack directory

__name__: string

Mod name

__packdir__: string

Full path to current Horizon pack directory

Functions

  • ConfigureMultiplayer(args: { isClientOnly: boolean; name: string; version: string }): void
  • Function that must be written in launcher.js to enable multiplayer configuration

    Parameters

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

    Returns void

  • 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

  • EntityAIWatcher(customPrototype: 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

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

    Parameters

    • 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

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

    Returns void

  • 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<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__(): 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

    Parameters

    • 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[]
    • main: number
    • str: string
  • 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.

    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

  • runOnClientThread(func: (() => void)): void
  • 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

        • (): void
        • Returns void

    Returns void

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

    Parameters

    • func: (() => void)

      function to be run in the main thread

        • (): void
        • Returns void

    Returns void

Generated using TypeDoc