Callback
Index
Interfaces
- BlockChangedFunction
- BreakBlockFunction
- BuildBlockFunction
- ConnectingToHostFunction
- ContainerClosedFunction
- ContainerOpenedFunction
- CoreConfiguredFunction
- CraftRecipePreProvidedFunction
- CraftRecipeProvidedFunction
- CustomBlockTessellationFunction
- CustomDimensionTransferFunction
- CustomWindowFunction
- DestroyBlockContinueFunction
- DestroyBlockFunction
- DimensionLoadedFunction
- DimensionUnloadedFunction
- EntityDeathFunction
- EntityFunction
- EntityHurtFunction
- EntityInteractFunction
- EntityPickUpDropFunction
- ExpAddFunction
- ExpLevelAddFunction
- ExpOrbsSpawnedFunction
- ExplosionFunction
- ExplosionParams
- FoodEatenFunction
- GenerateChunkFunction
- GenerateCustomDimensionChunkFunction
- ItemDispensedFunction
- ItemIconOverrideFunction
- ItemNameOverrideFunction
- ItemUseCoordinates
- ItemUseFunction
- ItemUseNoTargetFunction
- ItemUsingCompleteFunction
- ItemUsingReleasedFunction
- LegacyItemUseFunction
- LevelLoadedFunction
- LevelSelectedFunction
- NativeCommandFunction
- NativeGuiChangedFunction
- PlayerAttackFunction
- PlayerChangedDimensionFunction
- PlayerEatFunction
- PlayerFunction
- PlayerTickFunction
- PopBlockResourcesFunction
- ProjectileHitFunction
- ProjectileHitTarget
- RedstoneSignalFunction
- RedstoneSignalParams
- SavesFunction
- SystemKeyEventDispatchedFunction
- TileEntityAddedFunction
- TileEntityRemovedFunction
- VanillaWorkbenchCraftFunction
- VanillaWorkbenchRecipeSelectedFunction
Functions
Interfaces
BlockChangedFunction
Parameters
coords: Vector
coordinates where block change occurred
oldBlock: Tile
the block that is being replaced
newBlock: Tile
replacement block
region: BlockSource
Returns void
BreakBlockFunction
Parameters
region: BlockSource
coords: ItemUseCoordinates
coordinates where the block is placed and side from where it is placed
block: Tile
block that is placed
dropAllowed: boolean
playerUid: number
player entity unique numeric ID
item: ItemInstance
item that was in the player's hand when it breaked the block
Returns void
BuildBlockFunction
Parameters
coords: ItemUseCoordinates
coordinates where the block is placed and side from where it is placed
block: Tile
block that is placed
playerUid: number
player entity unique numeric ID
Returns void
ConnectingToHostFunction
Parameters
host: string
minecraftPort: number
moddedPort: number
Returns void
ContainerClosedFunction
ContainerOpenedFunction
CoreConfiguredFunction
Parameters
config: Config
Inner Core default config instance
Returns void
CraftRecipePreProvidedFunction
Parameters
recipe: WorkbenchRecipe
object containing recipe information
field: WorkbenchField
object containing crafting field information
playerUid: number
player which caused craft, since 2.4.0b122
Returns void
CraftRecipeProvidedFunction
Parameters
recipe: WorkbenchRecipe
object containing recipe information
field: WorkbenchField
object containing crafting field information
isPrevented: boolean
if
true
, recipe was prevented by craft functionplayerUid: number
player which caused craft, since 2.4.0b122
Returns void
CustomBlockTessellationFunction
CustomDimensionTransferFunction
Parameters
entityUid: number
entity that was transferred between dimensions
from: number
ID of the dimension the entity was transferred from
to: number
ID of the dimension the entity was transferred to
Returns void
CustomWindowFunction
Parameters
window: IWindow
window that was opened
Returns void
DestroyBlockContinueFunction
Parameters
coords: ItemUseCoordinates
coordinates where the block is destroyed and side from where it is destroyed
block: Tile
block that is destroyed
progress: number
current fraction of breaking progress
Returns void
DestroyBlockFunction
Parameters
coords: ItemUseCoordinates
coordinates where the block is destroyed and side from where it is destroyed
block: Tile
block that is destroyed
playerUid: number
player entity unique numeric ID
Returns void
DimensionLoadedFunction
Parameters
currentId: number
vanilla dimension ID, one of the EDimension values, or custom dimension ID
lastId: number
previous unloaded dimension ID
Returns void
DimensionUnloadedFunction
Parameters
dimensionId: number
Returns void
EntityDeathFunction
Parameters
entityUid: number
attackerUid: number
entity that caused damage, determines actor of damage source,
-1
otherwisedamageType: number
existing Entity.DamageSource or any inclusive value between 25 and 32
Returns void
EntityFunction
Parameters
entityUid: number
entity unique ID
Returns void
EntityHurtFunction
Parameters
attackerUid: number
entity that caused damage, determines actor of damage source,
-1
otherwiseentityUid: number
damageValue: number
produced damage value in half-hearts
damageType: number
existing Entity.DamageSource or any inclusive value between 25 and 32
armorReducesDamage: boolean
if
true
, damage can be reduced by armor
Returns void
EntityInteractFunction
Parameters
entityUid: number
entity unique ID
playerUid: number
player entity unique ID
coords: Vector
exact vector in which interaction happened
Returns void
EntityPickUpDropFunction
Parameters
entityUid: number
entity that picked up the item (this callback is currently called only for players)
dropEntityUid: number
dropped item's entity
item: ItemInstance
ItemInstance of the drop entity
count: number
which count of item stack
Returns any
ExpAddFunction
Parameters
exp: number
amount of experience to be added
playerUid: number
player's unique ID
Returns void
ExpLevelAddFunction
Parameters
level: number
amount of levels to be added
playerUid: number
player's uID
Returns void
ExpOrbsSpawnedFunction
Parameters
region: BlockSource
amount: number
amount of experience to be added
coords: Vector
dropped orbs entity coordinates
playerUid: number
player entity unique numeric ID
Returns void
ExplosionFunction
Parameters
coords: Vector
coordinates of the explosion
params: ExplosionParams
additional explosion data
Returns void
ExplosionParams
entity
If explosion is produced by an entity, entity unique ID, -1 otherwise.
onFire
If true
, explosion produced the fire.
power
Explosion power.
someBool
Should explosion break blocks or not.
someFloat
Max block resistance.
FoodEatenFunction
You can use Entity.getCarriedItem to get info about food item.
Parameters
food: number
food amount produced by eaten food
ratio: number
saturation ratio produced by food
playerUid: number
player entity UID
Returns void
GenerateChunkFunction
Parameters
chunkX: number
chunk X coordinate; multiply by 16 to receive corner block coordinates
chunkZ: number
chunk Z coordinate; multiply by 16 to receive corner block coordinates
random: Random
random object that should be used for generation process; already seeded by appropriate values
dimensionId: number
current dimension's numeric ID
chunkSeed: number
chunk-specific seed to use in chunk random generation
worldSeed: number
world-specific seed to use in chunk generation
dimensionSeed: number
dimension-specific seed to use in chunk generation
Returns void
GenerateCustomDimensionChunkFunction
Parameters
chunkX: number
chunk X coordinate; multiply by 16 to receive corner block coordinates
chunkZ: number
chunk Z coordinate; multiply by 16 to receive corner block coordinates
random: Random
random object that should be used for generation process; already seeded by appropriate values
dimensionId: number
current dimension's numeric ID
Returns void
ItemDispensedFunction
Parameters
coords: ItemUseCoordinates
full coords object, where the main coords are the position of the dispenser block,
relative
ones are the position of the block to which the dispenser is pointed, andvec
are the coords for the item to be dropped atitem: ItemInstance
item that was dispensed
region: BlockSource
BlockSource object
slot: number
numeric ID of the slot from which the item was dispensed
Returns void
ItemIconOverrideFunction
Parameters
item: ItemInstance
information about item that is used in override function
isModUi: boolean
whether icon override is working in mod ui or in vanilla one
Returns void | TextureData
Nothing if used in callback, Item.TextureData if used in item override function to return texture that will be used for the item.
ItemNameOverrideFunction
Parameters
item: ItemInstance
information about item that is used in override function
translation: string
translated item name
name: string
original item name
Returns string | void
Nothing if used in callback, string if used in item override function to return new name that will be displayed.
ItemUseCoordinates
Object used in some callbacks for coordinate set with side information and relative coordinates set.
relative
Relative coordinates, coordinates of the block to the specified side of current block.
side
Side of the block, one of the EBlockSide constants.
optionalvec
Exact touch point, absolute point coordinates. Used only in "ItemUse" callback.
x
y
z
ItemUseFunction
Parameters
coords: ItemUseCoordinates
set of all coordinate values that can be useful to write custom use logics
item: ItemInstance
item that was in the player's hand when it touched the block
block: Tile
block that was touched
playerUid: number
player entity UID
Returns void
ItemUseNoTargetFunction
Parameters
item: ItemInstance
item that was in the player's hand when the event occurred
playerUid: number
Returns void
ItemUsingCompleteFunction
Parameters
item: ItemInstance
item that was in the player's hand when the event occurred
playerUid: number
Returns void
ItemUsingReleasedFunction
Parameters
item: ItemInstance
item that was in the player's hand when the event occurred
ticks: number
amount of ticks left to the specified max use duration value
playerUid: number
Returns void
LegacyItemUseFunction
Parameters
coords: ItemUseCoordinates
set of all coordinate values that can be useful to write custom use logics, relative and vectorized one
item: ItemInstance
item that was in the player's hand when it touched the block
block: Tile
block that was touched
isExternal: boolean
received from external player on server
playerUid: number
player entity UID
Returns void
LevelLoadedFunction
Parameters
isServer: boolean
server-side or remote level is loaded
Returns void
LevelSelectedFunction
Parameters
worldName: string
name of the selected world
worldDir: string
name of the directory where the world is stored; worlds directories are located at
games/horizon/packs/Inner_Core/worlds/
Returns void
NativeCommandFunction
Parameters
command: string
command that was entered or
null
if no command was providen
Returns void
NativeGuiChangedFunction
Parameters
screenName: string
current screen name
lastScreenName: string
previous screen name
isPushEvent: boolean
if
true
, the new screen was pushed to the screen stack, popped from the stack otherwise
Returns void
PlayerAttackFunction
Parameters
attackerUid: number
player entity unique ID
victimUid: number
attacked entity unique ID
Returns void
PlayerChangedDimensionFunction
Parameters
playerUid: number
player entity unique numeric ID
currentId: number
vanilla dimension ID, one of the EDimension values, or custom dimension ID
lastId: number
previous unloaded dimension ID
Returns void
PlayerEatFunction
You can use Entity.getCarriedItem to get info about food item.
Parameters
playerUid: number
player entity UID
food: number
food amount produced by eaten food
ratio: number
saturation ratio produced by food
Returns void
PlayerFunction
Parameters
playerUid: number
unique ID of the player entity, that has been connected to server
Returns void
PlayerTickFunction
Parameters
playerUid: number
player entity unique ID
isDead: boolean
is following player dead
Returns void
PopBlockResourcesFunction
Parameters
coords: Vector
coordinates of the block that was broken
block: Tile
information about the block that was broken
explosionRadius: number
explosion power in case of exploding
cause: number
cause information, supposed to always be zero
region: BlockSource
Returns void
ProjectileHitFunction
Parameters
projectileUid: number
projectile entity unique ID
item: ItemInstance
projectile item
target: ProjectileHitTarget
object containing hit coordinates and information about hit entity/block
Returns void
ProjectileHitTarget
Object containing hit coordinates and information about hit entity/block.
coords
Coordinates and side of the hit block or null if an entity was hit.
entity
If an entity was hit, entity unique ID, -1
otherwise.
x
Exact hit position x.
y
Exact hit position y.
z
Exact hit position z.
RedstoneSignalFunction
Parameters
coords: Vector
coordinates where redstone signal changed
params: RedstoneSignalParams
information about redstone signal
block: Tile
information about the block on the specified coordinates
region: BlockSource
Returns void
RedstoneSignalParams
onLoad
true
if it is loading change.
power
Redstone signal power.
signal
Same as RedstoneSignalParams.power.
SavesFunction
Parameters
globalScope: object
Returns void
SystemKeyEventDispatchedFunction
Parameters
code: number
key code of pressed button
state: number
pressing state, such as down, etc.
Returns void
TileEntityAddedFunction
Parameters
updatable: Updatable | TileEntity
isTileEntity: boolean
Returns void
TileEntityRemovedFunction
Parameters
updatable: Updatable | TileEntity
Returns void
VanillaWorkbenchCraftFunction
Parameters
result: ItemInstance
recipe result item
workbenchContainer: Container
workbench container instance
playerUid: number
player which caused craft
Returns void
VanillaWorkbenchRecipeSelectedFunction
Parameters
recipe: WorkbenchRecipe
object containing recipe information
result: ItemInstance
recipe result item
workbenchContainer: Container
workbench container instance
Returns any
Functions
addCallback
Adds callback function for the specified callback name. Most of native events can be prevented using Game.prevent call.
Parameters
name: string
callback name, should be one of the pre-defined or a custom name if invoked via Callback.invokeCallback
func: Function
function to be called when an event occurs
optionalpriority: number
the more this value is, the earlier your callback handler will be called when an event occurs
Returns void
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 mod, use your own callback names.
Parameters
name: string
callback name
optionalo1: any
optionalo2: any
optionalo3: any
optionalo4: any
optionalo5: any
optionalo6: any
optionalo7: any
optionalo8: any
optionalo9: any
optionalo10: any
Returns void
Module used to handle callbacks. Investigate details about the callback mechanism and the list of pre-defined callbacks.