Minecraft基岩版开发Wiki:ICMod函式表

出自Minecraft基岩版开发Wiki

歡迎來到ICMod函式表的計劃條目。本計劃的目的是補全ICMod函式表。

貢獻者簽名[編輯]

若想參與本專案,請使用~~~在此簽名。

計劃建立者:方法放寒假 (T/C)

吳大傻討論

BigFish討論

Kokic討論

暮修

CatMelon留言

函式概述[編輯]

Namespaces[編輯]

Animation[編輯]

函式概述
名字 描述
Animation.Base
Animation.Item
Animation.base
Animation.Item

Armor[編輯]

Module used to manage armor's behavior

用於管理盔甲行為的模組

介面概述
名字 描述
Armor.ArmorGeneralFunction
Armor.ArmorHurtFunction
函式概述
名字 描述
Armor.preventDamaging Prevents armor from being damaged

阻止盔甲損壞

Armor.registerFuncs Registers armor's hurt and tick functions

註冊盔甲的hurt和tick的函式[注 1]

Armor.registerOnHurtListener This event is called when the damage is dealt to the player that has this armor put on.

此事件將在穿有此盔甲的玩家受到傷害時觸發

Armor.registerOnTakeOffListener This event is called when player takes off or changes this armor item.

此事件將在玩家脫下或更換盔甲時觸發

Armor.registerOnTakeOnListener This event is called when player takes on this armor, or spawns with it.

此事件將在玩家玩家穿上盔甲,或生成時即帶有盔甲時觸發

Armor.registerOnTickListener This event is called every tick for every player that has this armor put on.

此事件將對所有裝備此盔甲的玩家每時間刻觸發一次

  1. deprecated: Does not work in multiplayer 過時:此方法不在多人遊戲中正常工作

Block[編輯]

Module used to create and manipulate blocks. The difference between terms "block" and "tile" is in its usage: blocks are used in the inventory, tiles are placed in the world and have different ids for some vanilla blocks. Use Block.convertBlockToItemId and Block.convertItemToBlockId

用於建立和操縱方塊的模組。「Block(方塊)」和「Tile(區塊)」兩術語間的差別在於他們的用途:Block是在背包中使用的東西,而Tile是放置在世界中,且與原版方塊有不同id的東西。可使用Block.convertBlockToItemIdBlock.convertItemToBlockId 進行轉換。

介面概述
名字 描述
Block.AnimateTickFunction Function used to track random block animation ticks
Block.BlockVariation Object used to represent single block variation
Block.DropFunction Function used to determine block drop
Block.PlaceFunction Function used to determine when block is placed in the world
Block.PopResourcesFunction Function used to determine when block is broken by environment (explosions, pistons, etc.)
Block.RandomTickFunction Function used to track random block ticks
Block.SpecialType Special types are used to set properties to the block. Unlike items, blocks properties are defined using special types, due to old Inner Core's block ids limitations
函式概述
名字 描述
Block.convertBlockToItemId Converts tile id to the block id
Block.convertItemToBlockId Converts block id to the tile id
Block.createBlock Creates new block using specified params 用指定參數建立新方塊
Block.createBlockWithRotation Creates new block using specified params, creating four variations for each of the specified variations to be able to place it facing flayer with the front side and defines the appropriate behavior. Useful for different machines and mechanisms
Block.createSpecialType Creates a new special type using specified params and registers it by name
Block.getBlockDropViaItem Gets drop for the specified block. Used mostly by Core Engine's ToolAPI, though, can be useful in the mods, too
Block.getDestroyTime
Block.getExplosionResistance
Block.getFriction
Block.getLightLevel
Block.getLightOpacity
Block.getNumericId
Block.getRenderLayer
Block.getRenderType
Block.getTranslucency
Block.isNativeTile
Block.isSolid
Block.registerDropFunction Registers function used by Core Engine to determine block drop for the specified block id
Block.registerDropFunctionForID Same as Block.registerDropFunction but accepts only numeric tile id as the first param
Block.registerPlaceFunction Registers function to be called when the block is placed in the world
Block.registerPlaceFunctionForID Same as Block.registerPlaceFunction but accepts only numeric tile id as the first param
Block.registerPopResourcesFunction Registeres function used by Core Engine to determine block drop for the specified block id
Block.registerPopResourcesFunctionForID Same as Block.registerPopResourcesFunction but accepts only numeric tile id as the first param
Block.setAnimateTickCallback Makes block invoke callback randomly depending on game speed. Occurs more often than Block.setRandomTickCallback and only if the block is not far away from player
Block.setBlockMaterial Registers material and digging level for the specified block
Block.setBlockShape Sets block box shape
Block.setDestroyLevel Registers a default destroy function for the specified block, considering its digging level
Block.setDestroyLevelForID Same as Block.setDestroyLevel but accepts only numeric tile id as the first param
Block.setDestroyTime Sets destroy time for the block with specified id
Block.setPrototype [注 1]
Block.setRandomTickCallback Makes block invoke callback randomly depending on game speed
Block.setRedstoneTile Makes block accept redstone signal
Block.setShape Same as Block.setBlockShape, but accepts coordinates as scalar params, not objects
Block.setTempDestroyTime Temporarily sets destroy time for block, saving the old value for the further usage
  1. deprecated: No longer supported

BlockRenderer[編輯]

Callback[編輯]

Module used to handle in-game events. When some native event occurs, all callback functions registered for this event are called. Also you can invoke callback with any name manually using Callback.invokeCallback function.

用於處理遊戲中事件的模組。當原生遊戲事件觸發時,所有註冊到這個事件上的回呼函式都會被呼叫。你也可以透過Callback.invokeCallback手動觸發任何名字的回呼。

All pre-defined callbacks with their functions interfaces are listed below. If no function interface is provided, use a function with no params and return value:

所有預定義的回呼和他們的函式介面都列在了下面。如果函式介面未提供,請使用無參數和無傳回值的函式作為回呼函式:

UI 回呼
名字 描述
ContainerOpened occurs when user opens some container. See Callback.ContainerOpenedFunction for details 當玩家開啟一個容器時觸發。詳見Callback.ContainerOpenedFunction
ContainerClosed occurs when some container is closed. See Callback.ContainerClosedFunction for details 當一個容器被關閉時觸發。詳見Callback.ContainerClosedFunction
CustomWindowOpened occurs when every single window is opened. Called for every window and subwindow. Examples of subwindows include standard inventory, window title, main window, etc. See Callback.CustomWindowOpenedFunction for details 當單一視窗開啟時觸發。所有視窗及其子視窗都會呼叫該函式。子視窗例如標準物品欄,視窗標題,主視窗等。詳見Callback.CustomWindowOpenedFunction
CustomWindowClosed occurs when every single window is closed. See Callback.CustomWindowClosedFunction for details 當單一視窗關閉時觸發。詳見Callback.CustomWindowClosedFunction
工作台回呼
名字 描述
CraftRecipePreProvided occurs befor crafting is performed. See Callback.CraftRecipePreProvidedFunction for details 系統執行合成操作前觸發。詳見Callback.CraftRecipePreProvidedFunction
CraftRecipeProvided occurs afrer crafting recipe result is determined. See Callback.CraftRecipeProvidedFunction for details 當系統已確認合成配方的結果時觸發。詳見Callback.CraftRecipeProvidedFunction
VanillaWorkbenchCraft occurs just before adding crafting recipe result to player's inventory. See Callback.VanillaWorkbenchCraftFunction for details
VanillaWorkbenchPostCraft occurs after adding crafting recipe result to player's inventory. See Callback.VanillaWorkbenchCraftFunction for details
VanillaWorkbenchRecipeSelected occurs when player selects recipe in the workbench. See Callback.VanillaWorkbenchRecipeSelectedFunction for details
Inner CoreCore Engine 回呼
名字 描述
CoreConfigured occurs when Inner Core default configuration file is loaded. See Callback.CoreConfiguredFunction for details
PreLoaded occurs directly after "CoreConfigured" callback
APILoaded occurs directly after "PreLoaded" callback
ModsLoaded occurs directly after "APILoaded" callback
PostLoaded occurs directly after "ModsLoaded" callback. Last of the loading callbacks
AppSuspended occurs when Minecraft application is paused
NativeGuiChanged occurs when vanilla screen changes. See Callback.NativeGuiChangedFunction for details
ReadSaves occurs when reading saves from global scope. See Callback.SavesFunction for details
WriteSaves occurs when writing saves to global scope. See Callback.SavesFunction for details
世界維度回呼
名字 描述
tick is main game tick. This callback is called 20 times per second and is used to define all dynamic events in the game. Avoid overloading tick functions and use Callback.Updatables and Callback.TileEntitys when posssible
LevelSelected occurs when the level is selected and will be loaded. See Callback.LevelSelectedFunction for details
LevelCreated occurs when level is created in the memory of the device
LevelDisplayed occurs when level is displayed to the player
LevelPreLoaded 當存檔開始載入時呼叫(正在載入但是還沒進去時)
LevelLoaded 當存檔完全載入好時呼叫
DimensionLoaded occurs when vanilla or custom dimension is loaded. See Callback.DimensionLoadedFunction for details
LevelPreLeft 當玩家開始離開世界時呼叫
LevelLeft 當玩家完成離開世界時呼叫
PreBlocksDefined occurs before saving block data while loading world
BlocksDefined occurs after saving block data while loading world
玩家動作回呼
名字 描述
DestroyBlock 當玩家破壞方塊時呼叫(也就是方塊壞了的時候)。詳情看Callback.DestroyBlockFunction
DestroyBlockStart occurs when player starts breaking block. Has the same parameters as "DestroyBlock" callback, see Callback.DestroyBlockFunction for details
DestroyBlockContinue occurs when player continues breaking block. Occurs several times during one block breaking. See Callback.DestroyBlockContinueFunction for details
BuildBlock occurs when player places block somewhere in the world. See Callback.BuildBlockFunction for details
BlockChanged occurs when block changes in the world. To capture this event you should register blocks that you need to watch using Callback.World.setBlockChangeCallbackEnabled method. All block changes that are related to the registered blocks trigger this event. See Callback.BlockChangedFunction for details
ItemUse occurs when player uses item on some block. Doesn't work if vanilla container is opened (e.g. chest, workbench, etc.). Use "ItemUseLocalServer" to track such events instead. See Callback.ItemUseFunction for details
ItemUseLocalServer occurs when player uses some item on the local server. Can be used to prevent vanilla container from opening. See Callback.ItemUseFunction for details
FoodEaten 當玩家吃東西時呼叫。 詳情看 Callback.FoodEatenFunction
ExpAdd 當玩家經驗增加時呼叫。詳情看Callback.ExpAddFunciton
ExpLevelAdd 當玩家提升經驗等級時呼叫。詳情看Callback.ExpLevelAddFunciton
NativeCommand 當玩家輸入指令時呼叫。詳情看Callback.NativeCommandFunciton
PlayerAttack occurs when player attacks some entity. See Callback.PlayerAttackFunction for details
EntityInteract occurs when player longclick some entity (interacts with it). See Callback.EntityInteractFunction for details
ItemUseNoTarget 當玩家對著空氣使用物品時呼叫。詳情看Callback.ItemUseNoTargetFunction
ItemUsingReleased occurs when player doesn't complete using item that has maximum use time set with Callback.Item.setMaxUseDuration funciton. See Callback.ItemUsingReleasedFunction for details
ItemUsingComplete when player completes using item that has maximum use time set with Callback.Item.setMaxUseDuration funciton. See Callback.ItemUsingCompleteFunction for details
實體和環境回呼
名字 描述
Explosion occurs when something is exploded in the world. See Callback.ExplosionFunction for details
EntityAdded occurs when an entity is added in the world. See Callback.EntityAddedFunction for details
EntityRemoved occurs when an entity is removed from the world. See Callback.EntityRemovedFunction for details
EntityDeath occurs when an entity dies. See Callback.EntityDeathFunction for details
EntityHurt occurs when an entity is hurt. See Callback.EntityHurtFunction for details
ProjectileHit occurs when a projectile entity hits entity or block. See Callback.ProjectileHitFunction for details
物品方塊回呼
名字 描述
RedstoneSignal occurs when redstone signal changes on the specified coordinates. To register block as redstone consumer, use Callback.Block.setRedstoneTile function. See Callback.RedstoneSignalFunction for details
PopBlockResources occurs when block is desroyed somehow (not by player). See Callback.PopBlockResourcesFunction for details
CustomBlockTessellation
ItemIconOverride occurs when displaying item somewhere to override item's icon. You can use it to change item's icon depending on some item state. See Callback.ItemIconOverrideFunction for details
ItemNameOverride occurs when displaying item name to override it. You can use it to display item charge, status, etc. See Callback.ItemNameOverrideFunction for details
ItemDispensed occurs when an item is dispenced using dispenser. See Callback.ItemDispensedFunction for details
生成回呼
名字 描述
GenerateChunk occurs when generating chunk in overworld. Shoud be used for all generation process. See Callback.GenerateChunkFunction for details
GenerateChunkUnderground occurs when generating chunk's underground in overworld. Can be used for all underground generation process (though it is OK to use "GenerateChunk" for it as well). See Callback.GenerateChunkFunction for details
GenerateNetherChunk occurs when generating chunk in neather world. See Callback.GenerateChunkFunction for details
GenerateEndChunk occurs when generating chunk in end world. See Callback.GenerateChunkFunction for details
介面概述
名字 描述
Callback.BlockChangedFunction Function used in "BlockChanged" callback
Callback.BuildBlockFunction Function used in "BuildBlock" callback
Callback.ContainerClosedFunction Function used in "ContainerClosed" callback
Callback.ContainerOpenedFunction Function used in "ContainerOpened" callback
Callback.CoreConfiguredFunction Function used in "CoreConfigured" callback
Callback.CraftRecipePreProvidedFunction Function used in "CraftRecipePreProvided" callback
Callback.CraftRecipeProvidedFunction Function used in "CraftRecipeProvided" callback
Callback.CustomWindowClosedFunction Funciton used in "CustomWindowClosed" callback
Callback.CustomWindowOpenedFunction Funciton used in "CustomWindowOpened" callback
Callback.DestroyBlockContinueFunction Function used in "DestroyBlockContinue" callback
Callback.DestroyBlockFunction Function used in "DestroyBlock" and "DestroyBlockStart" callbacks
Callback.DimensionLoadedFunction Function used in "DimensionLoaded" callback
Callback.EntityAddedFunction Function used in "EntityAdded" callback
Callback.EntityDeathFunction Function used in "EntityDeath" callback
Callback.EntityHurtFunction Function used in "EntityHurt" callback
Callback.EntityInteractFunction Function used in "EntityInteract" callback
Callback.EntityRemovedFunction Function used in "EntityRemoved" callback
Callback.ExpAddFunciton Function used in "ExpAdd" callback
Callback.ExpLevelAddFunciton Function used in "ExpLevelAdd" callback
Callback.ExplosionFunction Function used in "Explosion" callback
Callback.FoodEatenFunction Function used in the "FoodEaten" callback. You can use Player.getCarriedItem to get info about food item
Callback.GenerateChunkFunction Function used in all generation callbacks
Callback.ItemDispensedFunction Function used in "ItemDispensed" callback
Callback.ItemIconOverrideFunction Function used in "ItemIconOverride" callback
Callback.ItemNameOverrideFunction Function used in "ItemNameOverride" callback
Callback.ItemUseCoordinates Object used in some callbacks for coordinate set with side information and relative coordinates set. Extended from BlockPosition by adding relative and accurate position.
Callback.ItemUseFunction Function used in "ItemUse" and "ItemUseLocalServer" callbacks
Callback.ItemUseNoTargetFunction Function used in "ItemUseNoTarget" callback
Callback.ItemUsingCompleteFunction Function used in "ItemUsingComplete" callback
Callback.ItemUsingReleasedFunction Function used in "ItemUsingReleased" callback
Callback.LevelSelectedFunction Function used in "LevelSelected" callback
Callback.NativeCommandFunciton Function used in "NativeCommand" callback
Callback.NativeGuiChangedFunction Function used in "NativeGuiChanged" callback
Callback.PlayerAttackFunction Function used in "PlayerAttack" callback
Callback.PopBlockResourcesFunction Funciton used in "PopBlockResources" callback
Callback.ProjectileHitFunction Function used in "ProjectileHit" callback
Callback.ProjectileHitTarget Object containing hit coordinates and information about hit entity/block
Callback.RedstoneSignalFunction Function used in "RedstoneSignal" callback
Callback.SavesFunction Function used in "ReadSaves" and "WriteSaves" callbacks
Callback.VanillaWorkbenchCraftFunction Function used in "VanillaWorkbenchCraft" and "VanillaWorkbenchPostCraft" callbacks
Callback.VanillaWorkbenchRecipeSelectedFunction Function used in "VanillaWorkbenchRecipeSelected" callback
函式概述
名字 描述
Callback.addCallback Adds callback function for the specified callback name. Most of native events can be prevented using Game.prevent call.
Callback.invokeCallback Invokes callback with any name and up to 10 additional parameters. You should not generally call pre-defined callbacks until you really need to do so. If you want to trigger some event in your mode, use your own callback names

Commands[編輯]

Namespace used to manipulate minecraft commands

函式概述
名字 描述
Commands.exec Executes specified command
Commands.execAt Executes specified command using specified coordinates as command location for all relative calculations

Debug[編輯]

Defines some useful methods for debugging

函式概述
名字 描述
Debug.addParticle Spawns vanilla debug particle on the specified coordinates
Debug.bitmap Diaplays an AlertDialog with given title and bitmap
Debug.error Writes error debug message (in red) to the chat
Debug.m Writes several comma-separated values to the chat as a general debug message, serializing javascript objects if possible
Debug.message Writes general debug message (in green) to the chat
Debug.sysTime Returns current system time in milliseconds
Debug.warning Writes warning debug message (in gold) to the chat

Dimensions[編輯]

Namespace used to create and manipulate custom dimensions

類概述
名字 描述
Dimensions.CustomDimension Class representing custom dimension
Dimensions.CustomGenerator Class representing landscape generator used for the dimension
Dimensions.MonoBiomeTerrainGenerator Class representing terrain that consists of single biome
Dimensions.NoiseConversion
Dimensions.NoiseGenerator
Dimensions.NoiseLayer
Dimensions.NoiseOctave
介面概述
名字 描述
Dimensions.AbstractTerrainGenerator
Dimensions.TerrainLayer Class representing single terrain layer that may consist of several noise layers
Dimensions.TerrainMaterial
函式概述
名字 描述
Dimensions.getDimensionById
Dimensions.getDimensionByName
Dimensions.isLimboId
Dimensions.overrideGeneratorForVanillaDimension Overrides default generator of vanilla dimension
Dimensions.transfer Transferes specified entity to the dimension with specified id

Entity[編輯]

Module used to manipulate entities (mobs, drop, arrows, etc.) in the world.Every entity has its unique numeric id which is often used across this module as the first function parameter

類概述
名字 描述
Entity.EntityHealth Class used to manipulate entity's health[注 1]
介面概述
名字 描述
Entity.MoveParams Interface used to specify how entity should move
Entity.MovingVector Interface used to return entity's current moving vector and some additional data
函式概述
名字 描述
Entity.addEffect Adds an effect to the mob
Entity.addPosition Updates current entity position by specified coordinates
Entity.addVelocity Updates current entity's velocity by specified valus
Entity.clearEffect Clears an effect applied to the mob
Entity.clearEffects Clears all effects of the mob
Entity.damageEntity Damages entity
Entity.findNearest Retreives nearest to the coordinates entity of the specified entity type
Entity.getAge [注 1]
Entity.getAll
Entity.getAllInRange
Entity.getAllJS [注 2]
Entity.getArmorSlot
Entity.getCarriedItem
Entity.getCustom Returns custom entity object by its numeric entity id
Entity.getDistanceBetweenCoords
Entity.getDistanceToCoords
Entity.getDistanceToEntity
Entity.getDroppedItem Gets item from specified drop entity
Entity.getExtra [注 3]
Entity.getExtraJson [注 4]
Entity.getHealth
Entity.getInventory [注 5]
Entity.getLookAngle
Entity.getLookAt
Entity.getLookVector
Entity.getLookVectorByAngle Transforms look angle into look vector
Entity.getMaxHealth
Entity.getMobile
Entity.getMovingAngle Retrieves entity look angle in the form of pitch/yaw angle. No other information included to the resulting object
Entity.getMovingAngleByPositions [注 6]
Entity.getMovingVector Retrieves entity's current movement information
Entity.getNameTag
Entity.getPosition
Entity.getProjectileItem [注 7]
Entity.getRender
Entity.getRider
Entity.getRiding
Entity.getSkin [注 8]
Entity.getSneaking
Entity.getTarget [注 9]
Entity.getType
Entity.getVelocity
Entity.getXZPlayerDis
Entity.healEntity Adds specified health amount to the entity
Entity.health [注 10]
Entity.isExist
Entity.lookAt Sets entity look angle to look at specified coordinates
Entity.lookAtCoords Same as Entity.lookAt but uses Vector as param type
Entity.moveToAngle Makes entity move using pitch/yaw angle to determine direction
Entity.moveToLook Makes entity move towords its current look angle
Entity.moveToTarget Makes entity move to the target corodinates
Entity.putExtra [注 11]
Entity.putExtraJson [注 12]
Entity.remove Removes entity from the world
Entity.rideAnimal Makes rider ride entity
Entity.setAge [注 13]
Entity.setArmorSlot Sets armor slot contents for the entity
Entity.setCarriedItem Sets currena carried item for the entity
Entity.setDroppedItem Sets item to the specified drop entity
Entity.setFire Puts entity on fire
Entity.setHealth Sets entity's current health value
Entity.setHitbox Sets hitbox to the entity. Hitboxes define entities collisions
Entity.setLookAngle Sets specified pitch and yaw as look angle for the entity
Entity.setMaxHealth Sets entity's maximum health value
Entity.setMobile Sets entity's immobile state
Entity.setNameTag Sets custom entity tag. Custom entity tags are displayed above the entities and can be set by player using label
Entity.setPosition Sets the specified coordinates as a new position for the entity. No checks are performed
Entity.setRender Sets entity render type
Entity.setSkin Sets mob skin
Entity.setSneaking Sets entity's sneaking state
Entity.setTarget [注 14]
Entity.setTexture Sets mob skin, uses Texture object to support animations
Entity.setVelocity Set current entity's velocity using velocity vector
Entity.spawn Spawns vanilla entity on the specified coordinates
Entity.spawnAtCoords Same as Entity.spawn, but uses Vector object to represent coordinates
Entity.spawnCustom Spawns custom entity on the specified coords. Allows to pass some values to controllers via extra param
Entity.spawnCustomAtCoords Same as Entity.spawnCustom, but uses Vector object to represent coordinates
  1. deprecated: No longer supported
  2. deprecated: Consider using Entity.getAll instead
  3. deprecated: No longer supported
  4. deprecated: No longer supported
  5. deprecated: No longer supported
  6. deprecated: No longer supported
  7. deprecated: No longer supported
  8. deprecated: No longer supported
  9. deprecated: No longer supported
  10. deprecated: Consider using Entity.getHealth, Entity.setHealth, Entity.getMaxHealth and Entity.setMaxHealth instead
  11. deprecated: No longer supported
  12. deprecated: No longer supported
  13. deprecated: No longer supported
  14. deprecated: No longer supported

EntityAI[編輯]

A set of predefined entity AI types

變數概述
名字 描述
EntityAI.Attack Attack AI type, entity causes damage to the target entity
EntityAI.Follow Follow AI type, entity follows its target. Use another AI type to set target for this AI type
EntityAI.Idle Simple idle AI type, entity just does nothing
EntityAI.Panic Panic AI type, entity jsut rushes around
EntityAI.PanicWatcher Panic AI watcher type, controls entity panic behavior after getting hurt
EntityAI.Swim Swim AI type, if the entity is in water, it swims
EntityAI.Wander Wander AI type, entity walks around making pauses

FileTools[編輯]

Module that provides methods to work with android file system

變數概述
名字 描述
FileTools.mntdir Defines path to android /mnt direcory
FileTools.moddir Defines mods folder path, ends with "/"
FileTools.root Defines user directory path, ends with "/"
函式概述
名字 描述
FileTools.GetListOfDirs Lists children directories for the specified path
FileTools.GetListOfFiles Lists files in the specified directory
FileTools.ReadBytesAsset Reads bytes array from assets
FileTools.ReadImage Reads bitmap from file
FileTools.ReadImageAsset Reads bitmap from asset by its full name
FileTools.ReadJSON Reads file as JSON
FileTools.ReadKeyValueFile Reads file as key:value pairs
FileTools.ReadText Reads text from file
FileTools.ReadTextAsset Reads string from asset by its full name
FileTools.WriteImage Writes bitmap to png file
FileTools.WriteJSON Writes object to file as JSON
FileTools.WriteKeyValueFile Writes key:value pairs to the file
FileTools.WriteText Writes text to the file
FileTools.getFullPath Converts home-relative path to absolute
FileTools.isExists Verifies if specified home-relative or absolute path exists
FileTools.mkdir Creates directory by its home-relative or absolute path, if one of the parent directories doesn't exist, creates them
FileTools.mkworkdirs Creates CoreEngine working directories. Called by CoreEngine and should not be called by end user

Game[編輯]

Module that provides some general game-related functions

函式概述
名字 描述
Game.dialogMessage Displays android AlertDialog with given message and dialog title
Game.getDifficulty
Game.getEngineVersion
Game.getGameMode
Game.getMinecraftVersion
Game.message Writes message to the chat. Message can be formatted using Native.ChatColor values
Game.prevent Prevents current callblack function from being called in Minecraft. For most callbacks it prevents default game behaviour
Game.setDifficulty Sets game difficulty, one of Native.GameDifficulty values
Game.setGameMode Sets current level game mode
Game.tipMessage Writes message above the hot bar. Message can be formatted using Native.ChatColor values

GameObjectRegistry[編輯]

命名空間概述
名字 描述
GameObjectRegistry.activeGameObjects
GameObjectRegistry.gameObjectTypes
函式概述
名字 描述
GameObjectRegistry.addGameObject
GameObjectRegistry.callForType
GameObjectRegistry.callForTypeSafe
GameObjectRegistry.deployGameObject
GameObjectRegistry.genUniqueName
GameObjectRegistry.getAllByType
GameObjectRegistry.registerClass
GameObjectRegistry.removeGameObject
GameObjectRegistry.resetEngine

GenerationUtils[編輯]

Module used to simplify generation tasks in mods logic

函式概述
名字 描述
GenerationUtils.canSeeSky
GenerationUtils.findHighSurface Finds nearest to y=128 coordinate empty space on the specified x and z coordinates
GenerationUtils.findLowSurface Finds nearest to y=64 coordinate empty space on the specified x and z coordinates
GenerationUtils.findSurface Finds nearest to the specified y coordinate empty space on the specified x and z coordinates
GenerationUtils.genMinable Generates ore vein on the specified coordinates using specified params[注 1]
GenerationUtils.generateOre Generates ore vein on the specified coordinates
GenerationUtils.isTerrainBlock
GenerationUtils.isTransparentBlock
GenerationUtils.lockInBlock
GenerationUtils.randomCoords Generates random coordinates inside specified chunk
GenerationUtils.randomXZ Generates random x and z coordinates inside specified chunk
GenerationUtils.setLockedBlock
  1. deprecated: Consider using GenerationUtils.generateOre instead

ICRender[編輯]

IDData[編輯]

命名空間概述
名字 描述
IDData.block
IDData.item

IDRegistry[編輯]

Item[編輯]

Module used to define items and their properties

類概述
名字 描述
Item.NativeItem
介面概述
名字 描述
Item.TextureData
函式概述
名字 描述
Item.addRepairItemIds Specifies what items can be used to repair this item in the envil
Item.addToCreative Adds item to creative inventory
Item.createArmorItem Creates armor item using specified parameters
Item.createFoodItem Creates eatable item using specified parameters
Item.createFuelItem [注 1]
Item.createItem Creates new item using specified parameters
Item.createThrowableItem Creates throwable item using specified parameters
Item.describeItem Applies several properties via one method call[注 2]
Item.getItemById Gets NativeItem instance that can be used to apply some properties to the item
Item.getMaxDamage
Item.getMaxStack
Item.getName
Item.getNumericId
Item.isNativeItem
Item.isValid
Item.registerDispenseFunction Registers function to be called when item is dispensed from dispenser.
Item.registerIconOverrideFunction Registers item id as requiring item icon override and registers function to perform such an override
Item.registerNameOverrideFunction Registers function to perform item name override
Item.registerNoTargetUseFunction Registers function to be called when player uses item in the air (not on the block)
Item.registerThrowableFunction Registers function that is called when throwable item with specified id hits block or entity
Item.registerThrowableFunctionForID Same as Item.registerThrowableFunction, but supports numeric ids only
Item.registerUseFunction Registers function that is called when user touches some block in the world with specified item
Item.registerUseFunctionForID Same as Item.registerUseFunction, but supports numeric ids only
Item.registerUsingCompleteFunction Registers function to be called when player completes using item that has maximum use time set with Item.setMaxUseDuration funciton
Item.registerUsingReleasedFunction Registers function to be called when player doesn't complete using item that has maximum use time set with Item.setMaxUseDuration funciton. Vanilla bow uses this function with max use duration of 72000 ticks
Item.setCategory Sets item creative category
Item.setEnchantType Specifies how the item can be enchanted
Item.setGlint Sets item as glint (like enchanted tools or golden apple)
Item.setLiquidClip
Item.setMaxDamage Sets item maximum data value
Item.setMaxUseDuration Limits maximum use duration. This is useful to create such items as bows
Item.setProperties Sets additional properties for the item, uses Minecraft mechanisms to set them. Full list of properties is currently unavailable
Item.setPrototype [注 3]
Item.setStackedByData [注 4]
Item.setToolRender Specifies how the player should hold the item
Item.setUseAnimation Sets animation type for the item
  1. deprecated: Use Item.createItem and RecipeRegistry.addFurnaceFuel instead
  2. deprecated: Consider using appropiate setters instead
  3. deprecated: Should not be used in new mods, consider using Item properties setters instead
  4. deprecated: No longer supported
  • LiquidRegistry
  • Logger - Module used to log messages to Inner Core log and android log
  • MobRegistry
  • MobSpawnRegistry
  • ModAPI - Module used to share mods' APIs
  • Native - Module containing enums that can make user code more readable
  • Particles
  • Player - Module used to manipulate player. Player is also an entity in Minecraft, so you can use all the functions from Entity module as well. To get player's entity id, call Player.get function
  • Recipes
  • Saver - Module used to save data between world sessions
  • Threading - Module used to create and manipulate threads. Threads let you execute time-consuming tasks without blocking current execution thread
  • ToolAPI - Module used to manage block and tools material and create tools with allrequired properties
  • Translation - Module that can be used to localize modsAll default strings (e.g. item names, windows titles, etc.) in the mod should be in English. Add translations to theese strings using Translation.addTranslation. For items and blocks translations are applied automatically. For the other strings, use Translation.translate
  • UI
  • Updatable - Module used to create and manage Updatables. Updatables provide the properway to manage objects that update their state every tick. Updatables may not be notified every tick, if there are too many, to avoid user interface freezes
  • World - Module that allows to work with current Minecraft world

Enumerations[編輯]

  • VanillaBlockID - Numeric IDs of vanilla blocks in the inventory
  • VanillaItemID - Numeric IDs of vanilla items
  • VanillaTileID - Numeric IDs of vanilla blocks placed in the world

Classes[編輯]

  • Config - Json configuration file reading/writing utility
  • CustomEntity
  • EntityAIClass - Class used to create new entity AI types
  • ItemExtra - Class representing item extra data
  • Model
  • ModelPart
  • NativeTileEntity
  • Render - Class that is used to give mobs, animations and blocks custom shape.
  • Texture
  • TileEntity - Class representing TileEntity in the worlds

Interfaces[編輯]

  • BlockPosition - Object representing coordinate set with side data
  • Color - Object representing RGB color
  • ItemInstance - Object representing item instance in the inventory
  • LookAngle - Object representing pitch/yaw angle set
  • PartObject
  • PartParameters - An interface of the object that is used as Render.addPart parameter
  • RenderParameters - An interface of the object that is used as Render.constructor parameter
  • Tile - Object representing block in the world
  • Updatable - Updatable is an object that is notified every tick via its Updatable.update method call
  • Vector - Object representing the set of coordinates in the three-dimensional world
  • Weather - Object representing current weather in the world

Type aliases[編輯]

  • ItemInstanceArray - Array of theee elements representing item id, count and data respectively. Used in many old functions and when extra data is not required
  • jarray - Generic type used to mark Java arrays of type T
  • jbyte - Type used to mark Java bytes
  • jobject - Generic type used to mark Java objects

Variables[編輯]

  • BlockID
  • ItemID
  • __config__ - Main mod configuration manager, settings are stored in config.json file
  • __dir__ - Full path to the mod's directory, ends with "/"
  • __mod__ - Java object of the mod, contains some useful values and methonds
  • __name__ - Mod name
  • __packdir__ - Full path to current Horizon pack directory

Functions[編輯]

  • EntityAIWatcher
  • EntityModel
  • EntityModelWatcher
  • GameObject
  • IMPORT
  • IMPORT_NATIVE
  • ItemExtraData
  • RenderMesh
  • WRAP_NATIVE
  • __debug_typecheck__
  • alert
  • getCoreAPILevel
  • getMCPEVersion
  • importLib
  • runCustomSource
  • runOnMainThread