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

来自Minecraft基岩版开发Wiki
暮修讨论 | 贡献2021年4月10日 (六) 07:52的版本 (Muxiuesd)

欢迎来到ICMod函数表的计划条目。本计划的目的是补全ICMod函数表。

贡献者签名

若想参与本项目,请使用~~~在此签名。

计划创建者:方法放寒假 (T/C)

吴大傻讨论

BigFish讨论

Kokic讨论

暮修

函数概述

Namespaces

Animation

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

Armor

Module used to manage armor's behavior 用于管理盔甲行为的模块

函数概述
名字 描述
Armor.preventDamaging Prevents armor from being damaged 阻止盔甲损坏[注 1]
Armor.registerFuncs Registers armor's hurt and tick functions 注册盔甲的hurt和tick的函数
  1. deprecated: Currently not implemented 不推荐:尚未实现

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